@indigo-labs/indigo-sdk 0.5.6 → 0.5.8
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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +42 -33
- package/dist/index.mjs +65 -56
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2556,7 +2556,9 @@ type InterestOracleParams = Data.Static<typeof InterestOracleParamsSchema>;
|
|
|
2556
2556
|
declare function castInterestOracleParams(params: InterestOracleParams): Data;
|
|
2557
2557
|
|
|
2558
2558
|
declare function startInterestOracle(initialUnitaryInterest: bigint, initialInterestRate: bigint, initialLastInterestUpdate: bigint, oracleParams: InterestOracleParams, lucid: LucidEvolution, interestTokenName?: string, withScriptRef?: boolean, refOutRef?: OutRef): Promise<[TxBuilder, AssetClass]>;
|
|
2559
|
-
declare function feedInterestOracle(params: InterestOracleParams, newInterestRate: bigint, lucid: LucidEvolution, assetClass?: AssetClass, utxo?: UTxO, scriptRef?: UTxO): Promise<TxBuilder>;
|
|
2559
|
+
declare function feedInterestOracle(params: InterestOracleParams, newInterestRate: bigint, lucid: LucidEvolution, assetClass?: AssetClass, utxo?: UTxO, scriptRef?: UTxO, currentSlot?: number, scriptOverrideCborHex?: string): Promise<TxBuilder>;
|
|
2560
|
+
|
|
2561
|
+
declare function findInterestOracle(lucid: LucidEvolution, interestNft: AssetClass): Promise<UTxO>;
|
|
2560
2562
|
|
|
2561
2563
|
declare function calculateUnitaryInterest(timePeriod: bigint, interestRate: bigint): bigint;
|
|
2562
2564
|
declare function calculateUnitaryInterestSinceOracleLastUpdated(now: bigint, oracleDatum: InterestOracleDatum): bigint;
|
|
@@ -4752,4 +4754,4 @@ declare function mkAuthTokenPolicy(ac: AssetClass, tn: string): MintingPolicy;
|
|
|
4752
4754
|
|
|
4753
4755
|
declare const alwaysFailValidator: SpendingValidator;
|
|
4754
4756
|
|
|
4755
|
-
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_BUY_ROB_REDEMPTIONS_COUNT, MAX_COLLATERAL_ASSETS_COUNT_PER_IASSET, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MAX_SELL_ROB_REDEMPTIONS_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OneShotParams, OneShotParamsSchema, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type PSMProcessingConfig, type ParsedOutput, type PollDatum, type PollManagerContent, PollManagerParams, type PollManagerParamsSP, type PollManagerRedeemer, type PollShardContent, PollShardParams, type PollShardParamsSP, type PollShardRedeemer, type PollStatus, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapInfo, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderInfo, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, type VoteOption, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculatePurchaseAmtWhenRobBuyOrder, calculatePurchaseAmtWhenRobSellOrder, calculateSpendAmtWhenRobBuyOrder, calculateSpendAmtWhenRobSellOrder, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castOneShotParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectPriceFeedIds, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, derivePythPrice, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateMinOrderOutputLovelaces, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findAdminInterestCollectors, findAllInterestCollectors, findAllTreasuryUtxos, findAllTreasuryUtxosWithNonAdaAsset, findCollateralAsset, findE2s2sSnapshots, findIAsset, findRandomCdpCreator, findRandomNonAdminInterestCollector, findRandomTreasuryUtxo, findRandomTreasuryUtxoWithAsset, findRandomTreasuryUtxoWithOnlyAda, findRelevantE2s2sIdxs, findStabilityPool, findStabilityPoolAccount, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkOneShotPolicy, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, numberToRational, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCdpRedeemer, parseCdpRedeemerOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePollManager, parsePollManagerOrThrow, parsePollShard, parsePollShardOrThrow, parsePollShardRedeemer, parsePollShardRedeemerOrThrow, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStabilityPoolRedeemer, parseStabilityPoolRedeemerOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, parseStakingRedeemer, parseStakingRedeemerOrThrow, partitionEpochToScaleToSums, pickValidSatisfiableOrders, processSpRequest, psmOrderType, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, rewardsPerAsset, robAmtToSpend, robBuyOrderFilledAssets, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, robSellOrderFilledAssets, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePollDatum, serialisePollManagerRedeemer, serialisePollShardRedeemer, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summariseOrder, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
|
4757
|
+
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_BUY_ROB_REDEMPTIONS_COUNT, MAX_COLLATERAL_ASSETS_COUNT_PER_IASSET, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MAX_SELL_ROB_REDEMPTIONS_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OneShotParams, OneShotParamsSchema, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type PSMProcessingConfig, type ParsedOutput, type PollDatum, type PollManagerContent, PollManagerParams, type PollManagerParamsSP, type PollManagerRedeemer, type PollShardContent, PollShardParams, type PollShardParamsSP, type PollShardRedeemer, type PollStatus, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapInfo, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderInfo, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, type VoteOption, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculatePurchaseAmtWhenRobBuyOrder, calculatePurchaseAmtWhenRobSellOrder, calculateSpendAmtWhenRobBuyOrder, calculateSpendAmtWhenRobSellOrder, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castOneShotParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectPriceFeedIds, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, derivePythPrice, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateMinOrderOutputLovelaces, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findAdminInterestCollectors, findAllInterestCollectors, findAllTreasuryUtxos, findAllTreasuryUtxosWithNonAdaAsset, findCollateralAsset, findE2s2sSnapshots, findIAsset, findInterestOracle, findRandomCdpCreator, findRandomNonAdminInterestCollector, findRandomTreasuryUtxo, findRandomTreasuryUtxoWithAsset, findRandomTreasuryUtxoWithOnlyAda, findRelevantE2s2sIdxs, findStabilityPool, findStabilityPoolAccount, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkOneShotPolicy, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, numberToRational, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCdpRedeemer, parseCdpRedeemerOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePollManager, parsePollManagerOrThrow, parsePollShard, parsePollShardOrThrow, parsePollShardRedeemer, parsePollShardRedeemerOrThrow, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStabilityPoolRedeemer, parseStabilityPoolRedeemerOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, parseStakingRedeemer, parseStakingRedeemerOrThrow, partitionEpochToScaleToSums, pickValidSatisfiableOrders, processSpRequest, psmOrderType, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, rewardsPerAsset, robAmtToSpend, robBuyOrderFilledAssets, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, robSellOrderFilledAssets, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePollDatum, serialisePollManagerRedeemer, serialisePollShardRedeemer, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summariseOrder, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
package/dist/index.d.ts
CHANGED
|
@@ -2556,7 +2556,9 @@ type InterestOracleParams = Data.Static<typeof InterestOracleParamsSchema>;
|
|
|
2556
2556
|
declare function castInterestOracleParams(params: InterestOracleParams): Data;
|
|
2557
2557
|
|
|
2558
2558
|
declare function startInterestOracle(initialUnitaryInterest: bigint, initialInterestRate: bigint, initialLastInterestUpdate: bigint, oracleParams: InterestOracleParams, lucid: LucidEvolution, interestTokenName?: string, withScriptRef?: boolean, refOutRef?: OutRef): Promise<[TxBuilder, AssetClass]>;
|
|
2559
|
-
declare function feedInterestOracle(params: InterestOracleParams, newInterestRate: bigint, lucid: LucidEvolution, assetClass?: AssetClass, utxo?: UTxO, scriptRef?: UTxO): Promise<TxBuilder>;
|
|
2559
|
+
declare function feedInterestOracle(params: InterestOracleParams, newInterestRate: bigint, lucid: LucidEvolution, assetClass?: AssetClass, utxo?: UTxO, scriptRef?: UTxO, currentSlot?: number, scriptOverrideCborHex?: string): Promise<TxBuilder>;
|
|
2560
|
+
|
|
2561
|
+
declare function findInterestOracle(lucid: LucidEvolution, interestNft: AssetClass): Promise<UTxO>;
|
|
2560
2562
|
|
|
2561
2563
|
declare function calculateUnitaryInterest(timePeriod: bigint, interestRate: bigint): bigint;
|
|
2562
2564
|
declare function calculateUnitaryInterestSinceOracleLastUpdated(now: bigint, oracleDatum: InterestOracleDatum): bigint;
|
|
@@ -4752,4 +4754,4 @@ declare function mkAuthTokenPolicy(ac: AssetClass, tn: string): MintingPolicy;
|
|
|
4752
4754
|
|
|
4753
4755
|
declare const alwaysFailValidator: SpendingValidator;
|
|
4754
4756
|
|
|
4755
|
-
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_BUY_ROB_REDEMPTIONS_COUNT, MAX_COLLATERAL_ASSETS_COUNT_PER_IASSET, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MAX_SELL_ROB_REDEMPTIONS_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OneShotParams, OneShotParamsSchema, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type PSMProcessingConfig, type ParsedOutput, type PollDatum, type PollManagerContent, PollManagerParams, type PollManagerParamsSP, type PollManagerRedeemer, type PollShardContent, PollShardParams, type PollShardParamsSP, type PollShardRedeemer, type PollStatus, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapInfo, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderInfo, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, type VoteOption, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculatePurchaseAmtWhenRobBuyOrder, calculatePurchaseAmtWhenRobSellOrder, calculateSpendAmtWhenRobBuyOrder, calculateSpendAmtWhenRobSellOrder, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castOneShotParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectPriceFeedIds, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, derivePythPrice, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateMinOrderOutputLovelaces, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findAdminInterestCollectors, findAllInterestCollectors, findAllTreasuryUtxos, findAllTreasuryUtxosWithNonAdaAsset, findCollateralAsset, findE2s2sSnapshots, findIAsset, findRandomCdpCreator, findRandomNonAdminInterestCollector, findRandomTreasuryUtxo, findRandomTreasuryUtxoWithAsset, findRandomTreasuryUtxoWithOnlyAda, findRelevantE2s2sIdxs, findStabilityPool, findStabilityPoolAccount, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkOneShotPolicy, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, numberToRational, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCdpRedeemer, parseCdpRedeemerOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePollManager, parsePollManagerOrThrow, parsePollShard, parsePollShardOrThrow, parsePollShardRedeemer, parsePollShardRedeemerOrThrow, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStabilityPoolRedeemer, parseStabilityPoolRedeemerOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, parseStakingRedeemer, parseStakingRedeemerOrThrow, partitionEpochToScaleToSums, pickValidSatisfiableOrders, processSpRequest, psmOrderType, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, rewardsPerAsset, robAmtToSpend, robBuyOrderFilledAssets, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, robSellOrderFilledAssets, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePollDatum, serialisePollManagerRedeemer, serialisePollShardRedeemer, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summariseOrder, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
|
4757
|
+
export { type AccountAction, type AccountContent, AccountContentSchema, type ActionReturnDatum, type AddCollateralAsssetContent, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AikenIntervalIntervalBound, AikenIntervalIntervalBoundType, type Amount, type AssetClassD, type AssetClassSP, AssetClassSchema, type AssetInfo, type AssetSnapshot, type AssetState, type AuthTokenPolicies, BASE_MAX_EXECUTION_FEE, BASE_MAX_TX_FEE, BigIntOrd, type CDPContent, CDPCreatorParams, type CDPCreatorParamsSP, type CDPDatum, CardanoTransactionValidityRange, type CdpParams, type CdpParamsSP, type CdpRedeemParams, type CdpRedeemParamsSP, type CdpRedeemer, type CollateralAssetContent, type CollateralAssetInfo, type CollateralAssetOutput, type CollectorParamsSP, type CollectorRedeemer, CollectorRedeemerSchema, CredentialD, CredentialSchema, type CurrencySymbolSP, DEFAULT_INIT_OPTIONS, type DerivedPythPrice, type DerivedPythPriceSP, DerivedPythPriceSchema, type E2S2SIndex, type E2S2SIndicesPerAsset, type EpochToScaleKey, type EpochToScaleToSumEntry, type ExecuteDatum, ExecuteParams, type ExecuteParamsSP, type Feed, type FindE2S2SIdxResult, type GovDatum, GovParams, type GovParamsSP, type GovRedeemer, type IAssetContent, type IAssetDatum, type IAssetOutput, type IAssetParamsSP, type IAssetPriceInfo, IAssetPriceInfoSchema, type IAssetRedeemer, IAssetScriptParams, INIT_TOKEN_NAMES, type IndigoOracleNftParam, type InitialAssetParam, type InitialCollateralAssetParam, type InitialStablepoolParam, type InitializeOptions, type Input, type InterestCollectionDatum, type InterestCollectionParams, type InterestCollectionParamsSP, InterestCollectionParamsSchema, type InterestCollectionRedeemer, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type InterestOracleRedeemer, MAX_BUY_ROB_REDEMPTIONS_COUNT, MAX_COLLATERAL_ASSETS_COUNT_PER_IASSET, MAX_E2S2S_ENTRIES_COUNT, MAX_REDEMPTIONS_WITH_CDP_OPEN, MAX_SELL_ROB_REDEMPTIONS_COUNT, MIN_ROB_COLLATERAL_AMT, type MarketSession, type ModifyStableswapPoolContent, ONE_DAY, ONE_HOUR, ONE_SECOND, ONE_YEAR, type OneShotParams, OneShotParamsSchema, type OracleIdx, OracleIdxSchema, type Output, PRICE_UPDATE_MAGIC, type PSMProcessingConfig, type ParsedOutput, type PollDatum, type PollManagerContent, PollManagerParams, type PollManagerParamsSP, type PollManagerRedeemer, type PollShardContent, PollShardParams, type PollShardParamsSP, type PollShardRedeemer, type PollStatus, type PriceOracleDatum, type PriceOracleParam, type PriceOracleParams, PriceOracleParamsSchema, type PriceOracleRedeemer, type PriceUpdate, type ProcessRequestAccountContent, type ProposalContent, ProposalContentSchema, type ProposeAssetContent, type ProposeStableswapPoolContent, type ProtocolParams, ProtocolParamsSchema, type PubKeyHash, type PythConfig, type PythConfiguration, type PythFeedConfig, type PythFeedParams, type PythFeedParamsSP, type PythFeedRedeemer, type PythMessageParts, type PythOracleParam, type PythPriceConfigurationSP, type PythStateDatum, type PythUpdatesRedeemer, type Rational, RationalSchema, type RedeemCdpWithdrawalRedeemer, type RobDatum, type RobOrderType, type RobOutput, type RobParams, type RobParamsSP, RobParamsSchema, type RobRedeemer, SOLANA_FORMAT_MAGIC, type SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, type StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, type StabilityPoolRedeemer, StabilityPoolRedeemerSchema, type StableswapInfo, type StableswapOrderDatum, StableswapOrderDatumSchema, type StableswapOrderInfo, type StableswapOrderRedeemer, type StableswapOutputDatum, type StableswapParamsSP, type StableswapPoolContent, StakeCredential, StakeCredentialSchema, type StakingManager, type StakingManagerOutput, type StakingParamsSP, type StakingPosLockedAmt, type StakingPosition, type StakingPositionOutput, type StakingRedeemer, type StartTime, type StateSnapshot, type SumSnapshot, type SystemParams, type TokenNameSP, type TreasuryParamsSP, type TreasuryWithdrawal, type TreasuryWithdrawalItem, TreasuryWithdrawalSchema, type UpgradePaths, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, VersionRecordTokenParams, type VoteOption, addrDetails, adjustCdp, adjustPriceToDecimals, adjustRob, adjustStakingPosition, alwaysFailValidator, annulRequest, approximateLeverageRedemptions, attachOracle, balance, batchCollectInterest, batchProcessStableswapOrders, bigintMax, bigintMin, buildRedemptionsTx, burnCdp, calculateAccruedInterest, calculateAdaReward, calculateCollateralRatioFromLeverage, calculateIAssetRedemptionAmt, calculateLeverageFromCollateralRatio, calculateMinCollateralCappedIAssetRedemptionAmt, calculatePurchaseAmtWhenRobBuyOrder, calculatePurchaseAmtWhenRobSellOrder, calculateSpendAmtWhenRobBuyOrder, calculateSpendAmtWhenRobSellOrder, calculateTotalCollateralForRedemption, calculateUnitaryInterest, calculateUnitaryInterestSinceOracleLastUpdated, cancelRob, cancelStableswapOrder, castCDPCreatorParams, castCdpParams, castCdpRedeemParams, castExecuteParams, castGovParams, castInterestCollectionParams, castInterestOracleParams, castOneShotParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castRobParams, castStabilityPoolParams, castStakingParams, castVersionRecordTokenParams, cdpCollateralRatioPercentage, claimRob, closeCdp, closeStakingPosition, collectInterestTx, collectPriceFeedIds, collectorFeeTx, createDestinationDatum, createE2s2sSnapshots, createProcessRequestAccountRedeemer, createProposal, createScriptAddress, createShardsChunks, createStableswapOrder, decodePriceUpdate, decodePythMessage, depositCdp, deriveAuthToken, derivePythPrice, distributeAda, distributeInterest, distributeReward, divideOnChainCompatible, encodePriceUpdate, encodePythMessage, encodeSignedPythMessage, endProposal, estimateMinOrderOutputLovelaces, estimateUtxoMinLovelace, executeProposal, feedInterestOracle, feedPriceOracleTx, findAdminInterestCollectors, findAllInterestCollectors, findAllTreasuryUtxos, findAllTreasuryUtxosWithNonAdaAsset, findCollateralAsset, findE2s2sSnapshots, findIAsset, findInterestOracle, findRandomCdpCreator, findRandomNonAdminInterestCollector, findRandomTreasuryUtxo, findRandomTreasuryUtxoWithAsset, findRandomTreasuryUtxoWithOnlyAda, findRelevantE2s2sIdxs, findStabilityPool, findStabilityPoolAccount, findStakingManager, findStakingManagerByOutRef, findStakingPositionByOutRef, freezeCdp, fromDataDerivedPythPrice, fromDecimal, fromSPInteger, fromSysParamsCredential, fromSysParamsDerivedPythPrice, fromSysParamsPythFeedParams, fromSysParamsStakeCredential, fromSystemParamsAsset, fromSystemParamsAssetLucid, fromSystemParamsScriptRef, getAssetClassComparisonStr, getInlineDatumOrThrow, getPythFeedConfig, getUpdatedAccountDeposit, handleOracleForCollateralAsset, iassetValueOfCollateral, init, initCDPCreator, initCollector, initGovernance, initInterestCollector, initPythConfig, initScriptRef, initSpState, initStakingManager, initSumVal, initTreasury, initializeAsset, insertSorted, isBuyOrderFullyRedeemed, isFullyRedeemed, isSameEpochToScaleKey, leverageCdpWithRob, liquidateCdp, liquidationHelper, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mergeCdps, mergeShards, mintAuthTokenDirect, mintCdp, mintOneTimeAsset, mintOneTimeToken, mkAuthTokenPolicy, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkCdpRedeemValidatorFromSP, mkCdpValidatorFromSP, mkCollectorValidatorFromSP, mkExecuteValidator, mkExecuteValidatorFromSP, mkGovValidator, mkGovValidatorFromSP, mkIAssetTokenPolicy, mkIAssetValidatorFromSP, mkInterestCollectionValidator, mkInterestCollectionValidatorFromSP, mkInterestOracleValidator, mkOneShotPolicy, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkPriceOracleValidator, mkPythFeedValidator, mkRobValidator, mkRobValidatorFromSP, mkSPInteger, mkStabilityPoolAddr, mkStabilityPoolValidator, mkStabilityPoolValidatorFromSP, mkStableswapValidator, mkStableswapValidatorFromSP, mkStakingValidatorFromSP, mkTreasuryAddr, mkTreasuryValidatorFromSP, mkVersionRecordTokenPolicy, mkVersionRegistryValidator, numberToRational, oneShotMintTx, openCdp, openRob, openStakingPosition, parseAccountDatum, parseAccountDatumOrThrow, parseCdpDatum, parseCdpDatumOrThrow, parseCdpRedeemer, parseCdpRedeemerOrThrow, parseCollateralAssetDatum, parseCollateralAssetDatumOrThrow, parseExecuteDatum, parseExecuteDatumOrThrow, parseGovDatum, parseGovDatumOrThrow, parseIAssetDatum, parseIAssetDatumOrThrow, parseInterestCollectionDatum, parseInterestOracleDatum, parsePollManager, parsePollManagerOrThrow, parsePollShard, parsePollShardOrThrow, parsePollShardRedeemer, parsePollShardRedeemerOrThrow, parsePriceOracleDatum, parsePythStateDatum, parseRobDatum, parseRobDatumOrThrow, parseRobRedeemer, parseRobRedeemerOrThrow, parseSnapshotEpochToScaleToSumDatum, parseSnapshotEpochToScaleToSumDatumOrThrow, parseStabilityPoolDatum, parseStabilityPoolDatumOrThrow, parseStabilityPoolRedeemer, parseStabilityPoolRedeemerOrThrow, parseStableswapOrderDatum, parseStableswapOrderDatumOrThrow, parseStableswapOrderRedeemer, parseStableswapOrderRedeemerOrThrow, parseStableswapPoolDatum, parseStableswapPoolDatumOrThrow, parseStakingManagerDatum, parseStakingPosition, parseStakingPositionOrThrow, parseStakingRedeemer, parseStakingRedeemerOrThrow, partitionEpochToScaleToSums, pickValidSatisfiableOrders, processSpRequest, psmOrderType, randomRobsSubsetSatisfyingTargetCollateral, rationalAdd, rationalCeil, rationalDiv, rationalFloor, rationalFromInt, rationalMul, rationalNegate, rationalSub, rationalToFloat, rationalZero, redeemCdp, redeemRob, repsertReadonlyArr, repsertWithReadonlyArr, requestSpAccountAdjustment, requestSpAccountClosure, requestSpAccountCreation, rewardSnapshotPrecision, rewardsPerAsset, robAmtToSpend, robBuyOrderFilledAssets, robBuyOrderSummary, robCollateralAmtToSpend, robIAssetAmtToSpend, robSellOrderFilledAssets, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseActionReturnDatum, serialiseCdpDatum, serialiseCdpRedeemer, serialiseCollectorRedeemer, serialiseExecuteDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseGovRedeemer, serialiseIAssetDatum, serialiseIAssetRedeemer, serialiseInterestCollectionDatum, serialiseInterestCollectionRedeemer, serialiseInterestOracleDatum, serialisePollDatum, serialisePollManagerRedeemer, serialisePollShardRedeemer, serialisePriceOracleDatum, serialisePriceOracleRedeemer, serialisePythFeedParams, serialisePythFeedRedeemer, serialisePythStateDatum, serialisePythUpdatesRedeemer, serialiseRedeemCdpWithdrawalRedeemer, serialiseRobDatum, serialiseRobRedeemer, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, serialiseStableswapOrderDatum, serialiseStableswapOrderRedeemer, serialiseStableswapOutputDatum, serialiseStableswapPoolDatum, serialiseStakingDatum, serialiseStakingRedeemer, shuffle, signersAllOf, spAdd, spDiv, spMul, spSub, spZeroNegatives, startInterestOracle, startPriceOracleTx, submitTx, sum, summariseOrder, summarizeActualLeverageRedemptions, toAssetClassFromLucid, toDataDerivedPythPrice, toSystemParamsAsset, treasuryCollect, treasuryFeeTx, treasuryMerge, treasuryPrepareWithdrawal, treasurySplit, updateAccount, updatePermissions, updatePoolStateWhenWithdrawalFee, updateStableswapPoolFees, updateStakingLockedAmount, vote, withdrawCdp, zeroNegatives };
|
package/dist/index.js
CHANGED
|
@@ -173,6 +173,7 @@ __export(index_exports, {
|
|
|
173
173
|
findCollateralAsset: () => findCollateralAsset,
|
|
174
174
|
findE2s2sSnapshots: () => findE2s2sSnapshots,
|
|
175
175
|
findIAsset: () => findIAsset,
|
|
176
|
+
findInterestOracle: () => findInterestOracle,
|
|
176
177
|
findRandomCdpCreator: () => findRandomCdpCreator,
|
|
177
178
|
findRandomNonAdminInterestCollector: () => findRandomNonAdminInterestCollector,
|
|
178
179
|
findRandomTreasuryUtxo: () => findRandomTreasuryUtxo,
|
|
@@ -7496,30 +7497,42 @@ function castStakingParams(params) {
|
|
|
7496
7497
|
// src/contracts/interest-oracle/transactions.ts
|
|
7497
7498
|
var import_lucid34 = require("@lucid-evolution/lucid");
|
|
7498
7499
|
|
|
7500
|
+
// src/contracts/interest-oracle/types.ts
|
|
7501
|
+
var import_lucid29 = require("@lucid-evolution/lucid");
|
|
7502
|
+
var InterestOracleParamsSchema = import_lucid29.Data.Object({
|
|
7503
|
+
/** Milliseconds */
|
|
7504
|
+
biasTime: import_lucid29.Data.Integer(),
|
|
7505
|
+
owner: import_lucid29.Data.Bytes()
|
|
7506
|
+
});
|
|
7507
|
+
var InterestOracleParams = InterestOracleParamsSchema;
|
|
7508
|
+
function castInterestOracleParams(params) {
|
|
7509
|
+
return import_lucid29.Data.castTo(params, InterestOracleParams);
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7499
7512
|
// src/contracts/one-shot/transactions.ts
|
|
7500
|
-
var
|
|
7513
|
+
var import_lucid32 = require("@lucid-evolution/lucid");
|
|
7501
7514
|
|
|
7502
7515
|
// src/contracts/one-shot/scripts.ts
|
|
7503
|
-
var
|
|
7516
|
+
var import_lucid31 = require("@lucid-evolution/lucid");
|
|
7504
7517
|
|
|
7505
7518
|
// src/contracts/one-shot/types.ts
|
|
7506
|
-
var
|
|
7507
|
-
var OneShotParamsSchema =
|
|
7508
|
-
referenceOutRef:
|
|
7509
|
-
txHash:
|
|
7510
|
-
outputIdx:
|
|
7519
|
+
var import_lucid30 = require("@lucid-evolution/lucid");
|
|
7520
|
+
var OneShotParamsSchema = import_lucid30.Data.Object({
|
|
7521
|
+
referenceOutRef: import_lucid30.Data.Object({
|
|
7522
|
+
txHash: import_lucid30.Data.Bytes(),
|
|
7523
|
+
outputIdx: import_lucid30.Data.Integer()
|
|
7511
7524
|
}),
|
|
7512
|
-
mintAmounts:
|
|
7513
|
-
|
|
7525
|
+
mintAmounts: import_lucid30.Data.Array(
|
|
7526
|
+
import_lucid30.Data.Object({
|
|
7514
7527
|
/// Use hex encoded string
|
|
7515
|
-
tokenName:
|
|
7516
|
-
amount:
|
|
7528
|
+
tokenName: import_lucid30.Data.Bytes(),
|
|
7529
|
+
amount: import_lucid30.Data.Integer()
|
|
7517
7530
|
})
|
|
7518
7531
|
)
|
|
7519
7532
|
});
|
|
7520
7533
|
var OneShotParams = OneShotParamsSchema;
|
|
7521
7534
|
function castOneShotParams(params) {
|
|
7522
|
-
return
|
|
7535
|
+
return import_lucid30.Data.castTo(params, OneShotParams);
|
|
7523
7536
|
}
|
|
7524
7537
|
|
|
7525
7538
|
// src/validators/one-shot-policy.ts
|
|
@@ -7533,7 +7546,7 @@ var _oneShotPolicy = {
|
|
|
7533
7546
|
function mkOneShotPolicy(params) {
|
|
7534
7547
|
return {
|
|
7535
7548
|
type: "PlutusV3",
|
|
7536
|
-
script: (0,
|
|
7549
|
+
script: (0, import_lucid31.applyParamsToScript)(_oneShotPolicy.cborHex, [
|
|
7537
7550
|
castOneShotParams(params)
|
|
7538
7551
|
])
|
|
7539
7552
|
};
|
|
@@ -7543,7 +7556,7 @@ function mkOneShotPolicy(params) {
|
|
|
7543
7556
|
var import_Array = require("fp-ts/lib/Array");
|
|
7544
7557
|
async function oneShotMintTx(lucid, params) {
|
|
7545
7558
|
const oneShotPolicy = mkOneShotPolicy(params);
|
|
7546
|
-
const policyId = (0,
|
|
7559
|
+
const policyId = (0, import_lucid32.mintingPolicyToId)(oneShotPolicy);
|
|
7547
7560
|
const refUtxo = matchSingle(
|
|
7548
7561
|
await lucid.utxosByOutRef([
|
|
7549
7562
|
{
|
|
@@ -7559,11 +7572,11 @@ async function oneShotMintTx(lucid, params) {
|
|
|
7559
7572
|
lucid.newTx().collectFrom([refUtxo]).mintAssets(
|
|
7560
7573
|
(0, import_Array.reduce)(
|
|
7561
7574
|
{},
|
|
7562
|
-
(acc, entry) => (0,
|
|
7563
|
-
[(0,
|
|
7575
|
+
(acc, entry) => (0, import_lucid32.addAssets)(acc, {
|
|
7576
|
+
[(0, import_lucid32.toUnit)(policyId, entry.tokenName)]: entry.amount
|
|
7564
7577
|
})
|
|
7565
7578
|
)(params.mintAmounts),
|
|
7566
|
-
|
|
7579
|
+
import_lucid32.Data.void()
|
|
7567
7580
|
).attach.MintingPolicy(oneShotPolicy),
|
|
7568
7581
|
policyId
|
|
7569
7582
|
];
|
|
@@ -7578,18 +7591,6 @@ async function runOneShotMintTx(lucid, params) {
|
|
|
7578
7591
|
// src/contracts/interest-oracle/scripts.ts
|
|
7579
7592
|
var import_lucid33 = require("@lucid-evolution/lucid");
|
|
7580
7593
|
|
|
7581
|
-
// src/contracts/interest-oracle/types.ts
|
|
7582
|
-
var import_lucid32 = require("@lucid-evolution/lucid");
|
|
7583
|
-
var InterestOracleParamsSchema = import_lucid32.Data.Object({
|
|
7584
|
-
/** Milliseconds */
|
|
7585
|
-
biasTime: import_lucid32.Data.Integer(),
|
|
7586
|
-
owner: import_lucid32.Data.Bytes()
|
|
7587
|
-
});
|
|
7588
|
-
var InterestOracleParams = InterestOracleParamsSchema;
|
|
7589
|
-
function castInterestOracleParams(params) {
|
|
7590
|
-
return import_lucid32.Data.castTo(params, InterestOracleParams);
|
|
7591
|
-
}
|
|
7592
|
-
|
|
7593
7594
|
// src/validators/interest-oracle-validator.ts
|
|
7594
7595
|
var _interestOracleValidator = {
|
|
7595
7596
|
type: "PlutusScriptV3",
|
|
@@ -7607,7 +7608,7 @@ function mkInterestOracleValidator(params) {
|
|
|
7607
7608
|
};
|
|
7608
7609
|
}
|
|
7609
7610
|
|
|
7610
|
-
//
|
|
7611
|
+
// src/contracts/interest-oracle/queries.ts
|
|
7611
7612
|
var import_cardano_offchain_common20 = require("@3rd-eye-labs/cardano-offchain-common");
|
|
7612
7613
|
async function findInterestOracle(lucid, interestNft) {
|
|
7613
7614
|
return lucid.utxoByUnit((0, import_cardano_offchain_common20.assetClassToUnit)(interestNft));
|
|
@@ -7666,19 +7667,26 @@ async function startInterestOracle(initialUnitaryInterest, initialInterestRate,
|
|
|
7666
7667
|
}
|
|
7667
7668
|
];
|
|
7668
7669
|
}
|
|
7669
|
-
async function feedInterestOracle(params, newInterestRate, lucid, assetClass, utxo, scriptRef2) {
|
|
7670
|
+
async function feedInterestOracle(params, newInterestRate, lucid, assetClass, utxo, scriptRef2, currentSlot, scriptOverrideCborHex) {
|
|
7670
7671
|
if (!assetClass && !utxo)
|
|
7671
7672
|
throw new Error("Either interest oracle nft or utxo must be provided");
|
|
7672
7673
|
if (assetClass && !utxo) {
|
|
7673
7674
|
utxo = await findInterestOracle(lucid, assetClass);
|
|
7674
7675
|
}
|
|
7675
|
-
const
|
|
7676
|
+
const slot = currentSlot !== void 0 ? currentSlot : lucid.currentSlot();
|
|
7677
|
+
const now = BigInt(lucid.slotToUnixTime(slot));
|
|
7676
7678
|
const tx = lucid.newTx();
|
|
7677
7679
|
const datum = parseInterestOracleDatum(getInlineDatumOrThrow(utxo));
|
|
7678
7680
|
if (scriptRef2) {
|
|
7679
7681
|
tx.readFrom([scriptRef2]);
|
|
7680
7682
|
} else {
|
|
7681
|
-
|
|
7683
|
+
const validator = scriptOverrideCborHex ? {
|
|
7684
|
+
type: "PlutusV3",
|
|
7685
|
+
script: (0, import_lucid34.applyParamsToScript)(scriptOverrideCborHex, [
|
|
7686
|
+
castInterestOracleParams(params)
|
|
7687
|
+
])
|
|
7688
|
+
} : mkInterestOracleValidator(params);
|
|
7689
|
+
tx.attach.Script(validator);
|
|
7682
7690
|
}
|
|
7683
7691
|
tx.collectFrom(
|
|
7684
7692
|
[utxo],
|
|
@@ -12230,6 +12238,7 @@ async function updateStableswapPoolFees(stableswapPoolOutRef, stableswapFeeOutRe
|
|
|
12230
12238
|
findCollateralAsset,
|
|
12231
12239
|
findE2s2sSnapshots,
|
|
12232
12240
|
findIAsset,
|
|
12241
|
+
findInterestOracle,
|
|
12233
12242
|
findRandomCdpCreator,
|
|
12234
12243
|
findRandomNonAdminInterestCollector,
|
|
12235
12244
|
findRandomTreasuryUtxo,
|
package/dist/index.mjs
CHANGED
|
@@ -7230,16 +7230,29 @@ function castStakingParams(params) {
|
|
|
7230
7230
|
|
|
7231
7231
|
// src/contracts/interest-oracle/transactions.ts
|
|
7232
7232
|
import {
|
|
7233
|
+
applyParamsToScript as applyParamsToScript9,
|
|
7233
7234
|
fromHex as fromHex10,
|
|
7234
7235
|
fromText as fromText6,
|
|
7235
7236
|
toUnit as toUnit2,
|
|
7236
7237
|
validatorToAddress
|
|
7237
7238
|
} from "@lucid-evolution/lucid";
|
|
7238
7239
|
|
|
7240
|
+
// src/contracts/interest-oracle/types.ts
|
|
7241
|
+
import { Data as Data34 } from "@lucid-evolution/lucid";
|
|
7242
|
+
var InterestOracleParamsSchema = Data34.Object({
|
|
7243
|
+
/** Milliseconds */
|
|
7244
|
+
biasTime: Data34.Integer(),
|
|
7245
|
+
owner: Data34.Bytes()
|
|
7246
|
+
});
|
|
7247
|
+
var InterestOracleParams = InterestOracleParamsSchema;
|
|
7248
|
+
function castInterestOracleParams(params) {
|
|
7249
|
+
return Data34.castTo(params, InterestOracleParams);
|
|
7250
|
+
}
|
|
7251
|
+
|
|
7239
7252
|
// src/contracts/one-shot/transactions.ts
|
|
7240
7253
|
import {
|
|
7241
7254
|
addAssets as addAssets10,
|
|
7242
|
-
Data as
|
|
7255
|
+
Data as Data36,
|
|
7243
7256
|
mintingPolicyToId,
|
|
7244
7257
|
toUnit
|
|
7245
7258
|
} from "@lucid-evolution/lucid";
|
|
@@ -7248,23 +7261,23 @@ import {
|
|
|
7248
7261
|
import { applyParamsToScript as applyParamsToScript7 } from "@lucid-evolution/lucid";
|
|
7249
7262
|
|
|
7250
7263
|
// src/contracts/one-shot/types.ts
|
|
7251
|
-
import { Data as
|
|
7252
|
-
var OneShotParamsSchema =
|
|
7253
|
-
referenceOutRef:
|
|
7254
|
-
txHash:
|
|
7255
|
-
outputIdx:
|
|
7264
|
+
import { Data as Data35 } from "@lucid-evolution/lucid";
|
|
7265
|
+
var OneShotParamsSchema = Data35.Object({
|
|
7266
|
+
referenceOutRef: Data35.Object({
|
|
7267
|
+
txHash: Data35.Bytes(),
|
|
7268
|
+
outputIdx: Data35.Integer()
|
|
7256
7269
|
}),
|
|
7257
|
-
mintAmounts:
|
|
7258
|
-
|
|
7270
|
+
mintAmounts: Data35.Array(
|
|
7271
|
+
Data35.Object({
|
|
7259
7272
|
/// Use hex encoded string
|
|
7260
|
-
tokenName:
|
|
7261
|
-
amount:
|
|
7273
|
+
tokenName: Data35.Bytes(),
|
|
7274
|
+
amount: Data35.Integer()
|
|
7262
7275
|
})
|
|
7263
7276
|
)
|
|
7264
7277
|
});
|
|
7265
7278
|
var OneShotParams = OneShotParamsSchema;
|
|
7266
7279
|
function castOneShotParams(params) {
|
|
7267
|
-
return
|
|
7280
|
+
return Data35.castTo(params, OneShotParams);
|
|
7268
7281
|
}
|
|
7269
7282
|
|
|
7270
7283
|
// src/validators/one-shot-policy.ts
|
|
@@ -7308,7 +7321,7 @@ async function oneShotMintTx(lucid, params) {
|
|
|
7308
7321
|
[toUnit(policyId, entry.tokenName)]: entry.amount
|
|
7309
7322
|
})
|
|
7310
7323
|
)(params.mintAmounts),
|
|
7311
|
-
|
|
7324
|
+
Data36.void()
|
|
7312
7325
|
).attach.MintingPolicy(oneShotPolicy),
|
|
7313
7326
|
policyId
|
|
7314
7327
|
];
|
|
@@ -7323,18 +7336,6 @@ async function runOneShotMintTx(lucid, params) {
|
|
|
7323
7336
|
// src/contracts/interest-oracle/scripts.ts
|
|
7324
7337
|
import { applyParamsToScript as applyParamsToScript8 } from "@lucid-evolution/lucid";
|
|
7325
7338
|
|
|
7326
|
-
// src/contracts/interest-oracle/types.ts
|
|
7327
|
-
import { Data as Data36 } from "@lucid-evolution/lucid";
|
|
7328
|
-
var InterestOracleParamsSchema = Data36.Object({
|
|
7329
|
-
/** Milliseconds */
|
|
7330
|
-
biasTime: Data36.Integer(),
|
|
7331
|
-
owner: Data36.Bytes()
|
|
7332
|
-
});
|
|
7333
|
-
var InterestOracleParams = InterestOracleParamsSchema;
|
|
7334
|
-
function castInterestOracleParams(params) {
|
|
7335
|
-
return Data36.castTo(params, InterestOracleParams);
|
|
7336
|
-
}
|
|
7337
|
-
|
|
7338
7339
|
// src/validators/interest-oracle-validator.ts
|
|
7339
7340
|
var _interestOracleValidator = {
|
|
7340
7341
|
type: "PlutusScriptV3",
|
|
@@ -7352,7 +7353,7 @@ function mkInterestOracleValidator(params) {
|
|
|
7352
7353
|
};
|
|
7353
7354
|
}
|
|
7354
7355
|
|
|
7355
|
-
//
|
|
7356
|
+
// src/contracts/interest-oracle/queries.ts
|
|
7356
7357
|
import {
|
|
7357
7358
|
assetClassToUnit as assetClassToUnit2
|
|
7358
7359
|
} from "@3rd-eye-labs/cardano-offchain-common";
|
|
@@ -7413,19 +7414,26 @@ async function startInterestOracle(initialUnitaryInterest, initialInterestRate,
|
|
|
7413
7414
|
}
|
|
7414
7415
|
];
|
|
7415
7416
|
}
|
|
7416
|
-
async function feedInterestOracle(params, newInterestRate, lucid, assetClass, utxo, scriptRef2) {
|
|
7417
|
+
async function feedInterestOracle(params, newInterestRate, lucid, assetClass, utxo, scriptRef2, currentSlot, scriptOverrideCborHex) {
|
|
7417
7418
|
if (!assetClass && !utxo)
|
|
7418
7419
|
throw new Error("Either interest oracle nft or utxo must be provided");
|
|
7419
7420
|
if (assetClass && !utxo) {
|
|
7420
7421
|
utxo = await findInterestOracle(lucid, assetClass);
|
|
7421
7422
|
}
|
|
7422
|
-
const
|
|
7423
|
+
const slot = currentSlot !== void 0 ? currentSlot : lucid.currentSlot();
|
|
7424
|
+
const now = BigInt(lucid.slotToUnixTime(slot));
|
|
7423
7425
|
const tx = lucid.newTx();
|
|
7424
7426
|
const datum = parseInterestOracleDatum(getInlineDatumOrThrow(utxo));
|
|
7425
7427
|
if (scriptRef2) {
|
|
7426
7428
|
tx.readFrom([scriptRef2]);
|
|
7427
7429
|
} else {
|
|
7428
|
-
|
|
7430
|
+
const validator = scriptOverrideCborHex ? {
|
|
7431
|
+
type: "PlutusV3",
|
|
7432
|
+
script: applyParamsToScript9(scriptOverrideCborHex, [
|
|
7433
|
+
castInterestOracleParams(params)
|
|
7434
|
+
])
|
|
7435
|
+
} : mkInterestOracleValidator(params);
|
|
7436
|
+
tx.attach.Script(validator);
|
|
7429
7437
|
}
|
|
7430
7438
|
tx.collectFrom(
|
|
7431
7439
|
[utxo],
|
|
@@ -7490,7 +7498,7 @@ function castInterestCollectionParams(params) {
|
|
|
7490
7498
|
}
|
|
7491
7499
|
|
|
7492
7500
|
// src/contracts/interest-collection/scripts.ts
|
|
7493
|
-
import { applyParamsToScript as
|
|
7501
|
+
import { applyParamsToScript as applyParamsToScript10 } from "@lucid-evolution/lucid";
|
|
7494
7502
|
|
|
7495
7503
|
// src/validators/interest-collection-validator.ts
|
|
7496
7504
|
var _interestCollectionValidator = {
|
|
@@ -7503,7 +7511,7 @@ var _interestCollectionValidator = {
|
|
|
7503
7511
|
function mkInterestCollectionValidator(params) {
|
|
7504
7512
|
return {
|
|
7505
7513
|
type: "PlutusV3",
|
|
7506
|
-
script:
|
|
7514
|
+
script: applyParamsToScript10(_interestCollectionValidator.cborHex, [
|
|
7507
7515
|
castInterestCollectionParams(params)
|
|
7508
7516
|
])
|
|
7509
7517
|
};
|
|
@@ -7511,7 +7519,7 @@ function mkInterestCollectionValidator(params) {
|
|
|
7511
7519
|
var mkInterestCollectionValidatorFromSP = (params) => {
|
|
7512
7520
|
return {
|
|
7513
7521
|
type: "PlutusV3",
|
|
7514
|
-
script:
|
|
7522
|
+
script: applyParamsToScript10(_interestCollectionValidator.cborHex, [
|
|
7515
7523
|
castInterestCollectionParams({
|
|
7516
7524
|
versionRecordNft: fromSystemParamsAssetLucid(params.versionRecordNft),
|
|
7517
7525
|
multisigUtxoNft: fromSystemParamsAssetLucid(params.multisigUtxoNft),
|
|
@@ -7589,7 +7597,7 @@ function castVersionRecordTokenParams(params) {
|
|
|
7589
7597
|
|
|
7590
7598
|
// src/contracts/version-registry/scripts.ts
|
|
7591
7599
|
import {
|
|
7592
|
-
applyParamsToScript as
|
|
7600
|
+
applyParamsToScript as applyParamsToScript11
|
|
7593
7601
|
} from "@lucid-evolution/lucid";
|
|
7594
7602
|
|
|
7595
7603
|
// src/validators/version-record-policy.ts
|
|
@@ -7610,7 +7618,7 @@ var _versionRegistryValidator = {
|
|
|
7610
7618
|
function mkVersionRecordTokenPolicy(params) {
|
|
7611
7619
|
return {
|
|
7612
7620
|
type: "PlutusV3",
|
|
7613
|
-
script:
|
|
7621
|
+
script: applyParamsToScript11(_versionRecordTokenPolicy.cborHex, [
|
|
7614
7622
|
castVersionRecordTokenParams(params)
|
|
7615
7623
|
])
|
|
7616
7624
|
};
|
|
@@ -7623,7 +7631,7 @@ var mkVersionRegistryValidator = () => {
|
|
|
7623
7631
|
};
|
|
7624
7632
|
|
|
7625
7633
|
// src/contracts/treasury/scripts.ts
|
|
7626
|
-
import { applyParamsToScript as
|
|
7634
|
+
import { applyParamsToScript as applyParamsToScript12 } from "@lucid-evolution/lucid";
|
|
7627
7635
|
|
|
7628
7636
|
// src/validators/treasury-validator.ts
|
|
7629
7637
|
var _treasuryValidator = {
|
|
@@ -7648,7 +7656,7 @@ function castTreasuryParams(params) {
|
|
|
7648
7656
|
var mkTreasuryValidatorFromSP = (params) => {
|
|
7649
7657
|
return {
|
|
7650
7658
|
type: "PlutusV3",
|
|
7651
|
-
script:
|
|
7659
|
+
script: applyParamsToScript12(_treasuryValidator.cborHex, [
|
|
7652
7660
|
castTreasuryParams({
|
|
7653
7661
|
upgradeToken: fromSystemParamsAssetLucid(params.upgradeToken),
|
|
7654
7662
|
versionRecordToken: fromSystemParamsAssetLucid(
|
|
@@ -7722,7 +7730,7 @@ async function findAllTreasuryUtxosWithNonAdaAsset(lucid, sysParams, includeDaoT
|
|
|
7722
7730
|
|
|
7723
7731
|
// src/contracts/collector/scripts.ts
|
|
7724
7732
|
import {
|
|
7725
|
-
applyParamsToScript as
|
|
7733
|
+
applyParamsToScript as applyParamsToScript13,
|
|
7726
7734
|
Constr as Constr2,
|
|
7727
7735
|
fromText as fromText7
|
|
7728
7736
|
} from "@lucid-evolution/lucid";
|
|
@@ -7738,7 +7746,7 @@ var _collectorValidator = {
|
|
|
7738
7746
|
var mkCollectorValidatorFromSP = (params) => {
|
|
7739
7747
|
return {
|
|
7740
7748
|
type: "PlutusV3",
|
|
7741
|
-
script:
|
|
7749
|
+
script: applyParamsToScript13(_collectorValidator.cborHex, [
|
|
7742
7750
|
new Constr2(0, [
|
|
7743
7751
|
new Constr2(0, [
|
|
7744
7752
|
params.stakingManagerNFT[0].unCurrencySymbol,
|
|
@@ -7781,7 +7789,7 @@ function castExecuteParams(params) {
|
|
|
7781
7789
|
|
|
7782
7790
|
// src/contracts/execute/scripts.ts
|
|
7783
7791
|
import {
|
|
7784
|
-
applyParamsToScript as
|
|
7792
|
+
applyParamsToScript as applyParamsToScript14,
|
|
7785
7793
|
applySingleCborEncoding
|
|
7786
7794
|
} from "@lucid-evolution/lucid";
|
|
7787
7795
|
|
|
@@ -7797,7 +7805,7 @@ var mkExecuteValidator = (params) => {
|
|
|
7797
7805
|
return {
|
|
7798
7806
|
type: "PlutusV3",
|
|
7799
7807
|
script: applySingleCborEncoding(
|
|
7800
|
-
|
|
7808
|
+
applyParamsToScript14(_executeValidator.cborHex, [
|
|
7801
7809
|
castExecuteParams(params)
|
|
7802
7810
|
])
|
|
7803
7811
|
)
|
|
@@ -7807,7 +7815,7 @@ var mkExecuteValidatorFromSP = (params) => {
|
|
|
7807
7815
|
return {
|
|
7808
7816
|
type: "PlutusV3",
|
|
7809
7817
|
script: applySingleCborEncoding(
|
|
7810
|
-
|
|
7818
|
+
applyParamsToScript14(_executeValidator.cborHex, [
|
|
7811
7819
|
castExecuteParams({
|
|
7812
7820
|
govNFT: fromSystemParamsAssetLucid(params.govNFT),
|
|
7813
7821
|
upgradeToken: fromSystemParamsAssetLucid(params.upgradeToken),
|
|
@@ -9335,7 +9343,7 @@ async function claimRob(lucid, robOutRef, sysParams) {
|
|
|
9335
9343
|
}
|
|
9336
9344
|
|
|
9337
9345
|
// src/contracts/rob/scripts.ts
|
|
9338
|
-
import { applyParamsToScript as
|
|
9346
|
+
import { applyParamsToScript as applyParamsToScript15 } from "@lucid-evolution/lucid";
|
|
9339
9347
|
|
|
9340
9348
|
// src/validators/rob-validator.ts
|
|
9341
9349
|
var _robValidator = {
|
|
@@ -9348,13 +9356,13 @@ var _robValidator = {
|
|
|
9348
9356
|
var mkRobValidator = (params) => {
|
|
9349
9357
|
return {
|
|
9350
9358
|
type: "PlutusV3",
|
|
9351
|
-
script:
|
|
9359
|
+
script: applyParamsToScript15(_robValidator.cborHex, [castRobParams(params)])
|
|
9352
9360
|
};
|
|
9353
9361
|
};
|
|
9354
9362
|
var mkRobValidatorFromSP = (params) => {
|
|
9355
9363
|
return {
|
|
9356
9364
|
type: "PlutusV3",
|
|
9357
|
-
script:
|
|
9365
|
+
script: applyParamsToScript15(_robValidator.cborHex, [
|
|
9358
9366
|
castRobParams({
|
|
9359
9367
|
versionRecordToken: fromSystemParamsAssetLucid(
|
|
9360
9368
|
params.versionRecordToken
|
|
@@ -9816,7 +9824,7 @@ import {
|
|
|
9816
9824
|
|
|
9817
9825
|
// src/contracts/price-oracle/scripts.ts
|
|
9818
9826
|
import {
|
|
9819
|
-
applyParamsToScript as
|
|
9827
|
+
applyParamsToScript as applyParamsToScript16
|
|
9820
9828
|
} from "@lucid-evolution/lucid";
|
|
9821
9829
|
|
|
9822
9830
|
// src/validators/price-oracle-validator.ts
|
|
@@ -9830,7 +9838,7 @@ var _priceOracleValidator = {
|
|
|
9830
9838
|
function mkPriceOracleValidator(params) {
|
|
9831
9839
|
return {
|
|
9832
9840
|
type: "PlutusV3",
|
|
9833
|
-
script:
|
|
9841
|
+
script: applyParamsToScript16(_priceOracleValidator.cborHex, [
|
|
9834
9842
|
castPriceOracleParams(params)
|
|
9835
9843
|
])
|
|
9836
9844
|
};
|
|
@@ -9939,7 +9947,7 @@ import {
|
|
|
9939
9947
|
|
|
9940
9948
|
// src/scripts/auth-token-policy.ts
|
|
9941
9949
|
import {
|
|
9942
|
-
applyParamsToScript as
|
|
9950
|
+
applyParamsToScript as applyParamsToScript17,
|
|
9943
9951
|
Constr as Constr3,
|
|
9944
9952
|
toHex as toHex15
|
|
9945
9953
|
} from "@lucid-evolution/lucid";
|
|
@@ -9950,7 +9958,7 @@ var authPolicyData = {
|
|
|
9950
9958
|
function mkAuthTokenPolicy(ac, tn) {
|
|
9951
9959
|
return {
|
|
9952
9960
|
type: authPolicyData.type,
|
|
9953
|
-
script:
|
|
9961
|
+
script: applyParamsToScript17(authPolicyData.cborHex, [
|
|
9954
9962
|
new Constr3(0, [toHex15(ac.currencySymbol), toHex15(ac.tokenName)]),
|
|
9955
9963
|
tn
|
|
9956
9964
|
])
|
|
@@ -9958,7 +9966,7 @@ function mkAuthTokenPolicy(ac, tn) {
|
|
|
9958
9966
|
}
|
|
9959
9967
|
|
|
9960
9968
|
// src/contracts/iasset/scripts.ts
|
|
9961
|
-
import { applyParamsToScript as
|
|
9969
|
+
import { applyParamsToScript as applyParamsToScript18 } from "@lucid-evolution/lucid";
|
|
9962
9970
|
|
|
9963
9971
|
// src/validators/iasset-validator.ts
|
|
9964
9972
|
var _iassetValidator = {
|
|
@@ -9977,7 +9985,7 @@ var IAssetScriptParams = IAssetScriptParamsSchema;
|
|
|
9977
9985
|
var mkIAssetValidatorFromSP = (params) => {
|
|
9978
9986
|
return {
|
|
9979
9987
|
type: "PlutusV3",
|
|
9980
|
-
script:
|
|
9988
|
+
script: applyParamsToScript18(_iassetValidator.cborHex, [
|
|
9981
9989
|
Data48.castTo(
|
|
9982
9990
|
{
|
|
9983
9991
|
upgradeToken: fromSystemParamsAssetLucid(params.upgradeToken),
|
|
@@ -10409,7 +10417,7 @@ import {
|
|
|
10409
10417
|
|
|
10410
10418
|
// src/scripts/iasset-policy.ts
|
|
10411
10419
|
import {
|
|
10412
|
-
applyParamsToScript as
|
|
10420
|
+
applyParamsToScript as applyParamsToScript19,
|
|
10413
10421
|
Constr as Constr4,
|
|
10414
10422
|
toHex as toHex16
|
|
10415
10423
|
} from "@lucid-evolution/lucid";
|
|
@@ -10420,14 +10428,14 @@ var iassetPolicyData = {
|
|
|
10420
10428
|
function mkIAssetTokenPolicy(ac) {
|
|
10421
10429
|
return {
|
|
10422
10430
|
type: iassetPolicyData.type,
|
|
10423
|
-
script:
|
|
10431
|
+
script: applyParamsToScript19(iassetPolicyData.cborHex, [
|
|
10424
10432
|
new Constr4(0, [toHex16(ac.currencySymbol), toHex16(ac.tokenName)])
|
|
10425
10433
|
])
|
|
10426
10434
|
};
|
|
10427
10435
|
}
|
|
10428
10436
|
|
|
10429
10437
|
// src/contracts/stableswap/scripts.ts
|
|
10430
|
-
import { applyParamsToScript as
|
|
10438
|
+
import { applyParamsToScript as applyParamsToScript20 } from "@lucid-evolution/lucid";
|
|
10431
10439
|
|
|
10432
10440
|
// src/contracts/stableswap/types.ts
|
|
10433
10441
|
import { Data as Data50 } from "@lucid-evolution/lucid";
|
|
@@ -10454,7 +10462,7 @@ var _stableswapValidator = {
|
|
|
10454
10462
|
var mkStableswapValidator = (params) => {
|
|
10455
10463
|
return {
|
|
10456
10464
|
type: "PlutusV3",
|
|
10457
|
-
script:
|
|
10465
|
+
script: applyParamsToScript20(_stableswapValidator.cborHex, [
|
|
10458
10466
|
castStableswapParams(params)
|
|
10459
10467
|
])
|
|
10460
10468
|
};
|
|
@@ -10462,7 +10470,7 @@ var mkStableswapValidator = (params) => {
|
|
|
10462
10470
|
var mkStableswapValidatorFromSP = (params) => {
|
|
10463
10471
|
return {
|
|
10464
10472
|
type: "PlutusV3",
|
|
10465
|
-
script:
|
|
10473
|
+
script: applyParamsToScript20(_stableswapValidator.cborHex, [
|
|
10466
10474
|
castStableswapParams({
|
|
10467
10475
|
iassetSymbol: params.iassetSymbol.unCurrencySymbol,
|
|
10468
10476
|
cdpToken: fromSystemParamsAssetLucid(params.cdpToken),
|
|
@@ -10484,11 +10492,11 @@ var _pythFeedValidator = {
|
|
|
10484
10492
|
};
|
|
10485
10493
|
|
|
10486
10494
|
// src/contracts/pyth-feed/scripts.ts
|
|
10487
|
-
import { applyParamsToScript as
|
|
10495
|
+
import { applyParamsToScript as applyParamsToScript21 } from "@evolution-sdk/evolution/uplc";
|
|
10488
10496
|
var mkPythFeedValidator = (params) => {
|
|
10489
10497
|
return {
|
|
10490
10498
|
type: "PlutusV3",
|
|
10491
|
-
script:
|
|
10499
|
+
script: applyParamsToScript21(_pythFeedValidator.cborHex, [
|
|
10492
10500
|
serialisePythFeedParams(params)
|
|
10493
10501
|
])
|
|
10494
10502
|
};
|
|
@@ -12142,6 +12150,7 @@ export {
|
|
|
12142
12150
|
findCollateralAsset,
|
|
12143
12151
|
findE2s2sSnapshots,
|
|
12144
12152
|
findIAsset,
|
|
12153
|
+
findInterestOracle,
|
|
12145
12154
|
findRandomCdpCreator,
|
|
12146
12155
|
findRandomNonAdminInterestCollector,
|
|
12147
12156
|
findRandomTreasuryUtxo,
|