@indigo-labs/indigo-sdk 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.github/workflows/ci.yml +62 -0
  2. package/.github/workflows/test.yml +44 -0
  3. package/.husky/pre-commit +1 -0
  4. package/.prettierrc +1 -1
  5. package/README.md +52 -7
  6. package/dist/index.d.mts +1064 -182
  7. package/dist/index.d.ts +1064 -182
  8. package/dist/index.js +2565 -561
  9. package/dist/index.mjs +2546 -593
  10. package/eslint.config.mjs +35 -0
  11. package/package.json +61 -43
  12. package/src/contracts/cdp.ts +208 -359
  13. package/src/contracts/collector.ts +13 -6
  14. package/src/contracts/gov.ts +1 -58
  15. package/src/contracts/interest-oracle.ts +139 -39
  16. package/src/contracts/lrp.ts +223 -0
  17. package/src/contracts/one-shot.ts +67 -0
  18. package/src/contracts/stability-pool.ts +684 -0
  19. package/src/contracts/staking.ts +348 -0
  20. package/src/contracts/treasury.ts +30 -13
  21. package/src/helpers/asset-helpers.ts +51 -22
  22. package/src/helpers/helper-txs.ts +30 -0
  23. package/src/helpers/helpers.ts +29 -8
  24. package/src/helpers/indigo-helpers.ts +19 -0
  25. package/src/helpers/interest-oracle.ts +57 -0
  26. package/src/helpers/lucid-utils.ts +62 -16
  27. package/src/helpers/price-oracle-helpers.ts +36 -0
  28. package/src/helpers/stability-pool-helpers.ts +207 -0
  29. package/src/helpers/staking-helpers.ts +94 -0
  30. package/src/helpers/time-helpers.ts +4 -3
  31. package/src/helpers/value-helpers.ts +16 -0
  32. package/src/index.ts +15 -4
  33. package/src/scripts/always-fail-validator.ts +7 -0
  34. package/src/scripts/auth-token-policy.ts +23 -0
  35. package/src/scripts/cdp-creator-validator.ts +46 -2
  36. package/src/scripts/collector-validator.ts +2 -2
  37. package/src/scripts/execute-validator.ts +52 -0
  38. package/src/scripts/gov-validator.ts +44 -0
  39. package/src/scripts/iasset-policy.ts +22 -0
  40. package/src/scripts/interest-oracle-validator.ts +18 -3
  41. package/src/scripts/lrp-validator.ts +23 -0
  42. package/src/scripts/one-shot-policy.ts +62 -0
  43. package/src/scripts/poll-manager-validator.ts +52 -0
  44. package/src/scripts/poll-shard-validator.ts +47 -0
  45. package/src/scripts/price-oracle-validator.ts +26 -0
  46. package/src/scripts/stability-pool-validator.ts +60 -0
  47. package/src/scripts/staking-validator.ts +8 -0
  48. package/src/scripts/version-record-policy.ts +26 -0
  49. package/src/scripts/version-registry.ts +15 -0
  50. package/src/types/generic.ts +99 -6
  51. package/src/types/indigo/cdp-creator.ts +46 -0
  52. package/src/types/indigo/cdp.ts +86 -31
  53. package/src/types/indigo/execute.ts +21 -0
  54. package/src/types/indigo/gov.ts +50 -20
  55. package/src/types/indigo/interest-oracle.ts +55 -5
  56. package/src/types/indigo/lrp.ts +54 -0
  57. package/src/types/indigo/poll-manager.ts +21 -0
  58. package/src/types/indigo/poll-shard.ts +16 -0
  59. package/src/types/indigo/price-oracle.ts +38 -4
  60. package/src/types/indigo/stability-pool.ts +233 -0
  61. package/src/types/indigo/staking.ts +99 -0
  62. package/src/types/indigo/version-record.ts +17 -0
  63. package/src/types/on-chain-decimal.ts +23 -0
  64. package/src/types/one-shot.ts +22 -0
  65. package/src/types/system-params.ts +95 -77
  66. package/tests/data/system-params.json +972 -972
  67. package/tests/datums.test.ts +279 -44
  68. package/tests/endpoints/initialize.ts +1013 -0
  69. package/tests/hash-checks.test.ts +71 -15
  70. package/tests/indigo-test-helpers.ts +115 -0
  71. package/tests/initialize.test.ts +27 -0
  72. package/tests/interest-calculations.test.ts +110 -133
  73. package/tests/interest-oracle.test.ts +90 -0
  74. package/tests/lrp.test.ts +149 -0
  75. package/tests/queries/governance-queries.ts +31 -0
  76. package/tests/queries/iasset-queries.ts +39 -0
  77. package/tests/queries/interest-oracle-queries.ts +13 -0
  78. package/tests/queries/lrp-queries.ts +39 -0
  79. package/tests/queries/price-oracle-queries.ts +27 -0
  80. package/tests/queries/stability-pool-queries.ts +75 -0
  81. package/tests/queries/staking-queries.ts +43 -0
  82. package/tests/stability-pool.test.ts +364 -0
  83. package/tests/staking.test.ts +105 -0
  84. package/tests/test-helpers.ts +38 -0
  85. package/tsconfig.build.json +4 -0
  86. package/tsconfig.json +8 -27
  87. package/vitest.config.ts +9 -0
  88. package/babel.config.cjs +0 -13
  89. package/jest.config.js +0 -13
  90. package/src/contracts/cdp-creator.ts +0 -86
  91. package/src/contracts/price-oracle.ts +0 -24
  92. package/src/helpers/cdp-helpers.ts +0 -9
package/dist/index.d.mts CHANGED
@@ -1,33 +1,79 @@
1
- import { LucidEvolution, Address as Address$1, SpendingValidator, Credential, Data, UTxO, OutRef, TxBuilder, Constr, Assets, ScriptType } from '@lucid-evolution/lucid';
1
+ import * as _lucid_evolution_lucid from '@lucid-evolution/lucid';
2
+ import { Data, LucidEvolution, OutRef, TxBuilder, SpendingValidator, Credential as Credential$1, UTxO, Address as Address$1, Datum, Network, ScriptHash, Assets, ScriptType, Redeemer, PolicyId } from '@lucid-evolution/lucid';
2
3
 
3
- interface OnChainDecimal {
4
- getOnChainInt: bigint;
5
- }
4
+ declare const AssetClassSchema: _lucid_evolution_lucid.TObject<{
5
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
6
+ /** Use the HEX encoding */
7
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
8
+ }>;
9
+ type AssetClass = Data.Static<typeof AssetClassSchema>;
10
+ declare const OutputReferenceSchema: _lucid_evolution_lucid.TObject<{
11
+ txHash: _lucid_evolution_lucid.TObject<{
12
+ hash: _lucid_evolution_lucid.TUnsafe<string>;
13
+ }>;
14
+ outputIndex: _lucid_evolution_lucid.TUnsafe<bigint>;
15
+ }>;
16
+ type OutputReference = Data.Static<typeof OutputReferenceSchema>;
17
+ declare const VerificationKeyHashSchema: _lucid_evolution_lucid.TUnsafe<string>;
18
+ declare const CredentialSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
19
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
20
+ }> | _lucid_evolution_lucid.TObject<{
21
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
22
+ }>)[]>;
23
+ type Credential = Data.Static<typeof CredentialSchema>;
24
+ declare const Credential: Credential;
25
+ declare const AddressSchema: _lucid_evolution_lucid.TObject<{
26
+ paymentCredential: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
27
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
28
+ }> | _lucid_evolution_lucid.TObject<{
29
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
30
+ }>)[]>;
31
+ stakeCredential: _lucid_evolution_lucid.TUnsafe<{
32
+ Inline: [{
33
+ PublicKeyCredential: [string];
34
+ } | {
35
+ ScriptCredential: [string];
36
+ }];
37
+ } | {
38
+ Pointer: [{
39
+ slotNumber: bigint;
40
+ transactionIndex: bigint;
41
+ certificateIndex: bigint;
42
+ }];
43
+ }>;
44
+ }>;
45
+ type Address = Data.Static<typeof AddressSchema>;
46
+ declare const Address: Address;
47
+ declare function addressToBech32(lucid: LucidEvolution, address: Address): string;
48
+ declare function addressFromBech32(address: string): Address;
6
49
  interface CurrencySymbol {
7
50
  unCurrencySymbol: string;
8
51
  }
9
52
  interface TokenName {
10
53
  unTokenName: string;
11
54
  }
12
- type AssetClass = [CurrencySymbol, TokenName];
13
55
 
56
+ /**
57
+ * AssetClassSP used in System Params
58
+ */
59
+ type AssetClassSP = [CurrencySymbol, TokenName];
14
60
  interface SystemParams {
15
61
  versionRecordParams: VersionRecordParams;
16
62
  validatorHashes: ValidatorHashes;
17
63
  treasuryParams: TreasuryParams;
18
64
  startTime: StartTime;
19
65
  stakingParams: StakingParams;
20
- stabilityPoolParams: StabilityPoolParams;
66
+ stabilityPoolParams: StabilityPoolParamsSP;
21
67
  scriptReferences: ScriptReferences;
22
- pollShardParams: PollShardParams;
23
- pollManagerParams: PollManagerParams;
24
- indyToken: AssetClass;
25
- govParams: GovParams;
26
- executeParams: ExecuteParams;
68
+ pollShardParams: PollShardParamsSP;
69
+ pollManagerParams: PollManagerParamsSP;
70
+ indyToken: AssetClassSP;
71
+ govParams: GovParamsSP;
72
+ executeParams: ExecuteParamsSP;
27
73
  distributionParams: DistributionParams;
28
74
  collectorParams: CollectorParams;
29
75
  cdpParams: CdpParams;
30
- cdpCreatorParams: CdpCreatorParams;
76
+ cdpCreatorParams: CDPCreatorParamsSP;
31
77
  }
32
78
  type ValidatorHashes = {
33
79
  versionRegistryHash: string;
@@ -57,11 +103,11 @@ interface PubKeyHash {
57
103
  getPubKeyHash: string;
58
104
  }
59
105
  interface VersionRecordParams {
60
- upgradeToken: AssetClass;
106
+ upgradeToken: AssetClassSP;
61
107
  }
62
108
  interface TreasuryParams {
63
- upgradeToken: AssetClass;
64
- versionRecordToken: AssetClass;
109
+ upgradeToken: AssetClassSP;
110
+ versionRecordToken: AssetClassSP;
65
111
  treasuryUtxosStakeCredential?: ScriptCredential;
66
112
  }
67
113
  interface StartTime {
@@ -69,24 +115,24 @@ interface StartTime {
69
115
  blockHeader: string;
70
116
  }
71
117
  interface StakingParams {
72
- versionRecordToken: AssetClass;
73
- stakingToken: AssetClass;
74
- stakingManagerNFT: AssetClass;
75
- pollToken: AssetClass;
76
- indyToken: AssetClass;
118
+ versionRecordToken: AssetClassSP;
119
+ stakingToken: AssetClassSP;
120
+ stakingManagerNFT: AssetClassSP;
121
+ pollToken: AssetClassSP;
122
+ indyToken: AssetClassSP;
77
123
  collectorValHash: string;
78
124
  }
79
- interface StabilityPoolParams {
80
- versionRecordToken: AssetClass;
81
- stabilityPoolToken: AssetClass;
82
- snapshotEpochToScaleToSumToken: AssetClass;
125
+ interface StabilityPoolParamsSP {
126
+ versionRecordToken: AssetClassSP;
127
+ stabilityPoolToken: AssetClassSP;
128
+ snapshotEpochToScaleToSumToken: AssetClassSP;
83
129
  requestCollateralLovelaces: number;
84
- iAssetAuthToken: AssetClass;
85
- govNFT: AssetClass;
130
+ iAssetAuthToken: AssetClassSP;
131
+ govNFT: AssetClassSP;
86
132
  collectorValHash: string;
87
- cdpToken: AssetClass;
133
+ cdpToken: AssetClassSP;
88
134
  assetSymbol: CurrencySymbol;
89
- accountToken: AssetClass;
135
+ accountToken: AssetClassSP;
90
136
  accountCreateFeeLovelaces: number;
91
137
  accountAdjustmentFeeLovelaces: number;
92
138
  }
@@ -120,16 +166,16 @@ interface ScriptOutput {
120
166
  referenceScript: string;
121
167
  datum: AddressCredentialOrDatum;
122
168
  amount: Amount;
123
- address: Address;
169
+ address: AddressSP;
124
170
  }
125
171
  interface AddressCredentialOrDatum {
126
172
  tag: string;
127
173
  contents: string;
128
174
  }
129
175
  interface Amount {
130
- getValue?: ((CurrencySymbol | ((number)[] | null)[] | null)[] | null)[] | null;
176
+ getValue?: ((CurrencySymbol | (number[] | null)[] | null)[] | null)[] | null;
131
177
  }
132
- interface Address {
178
+ interface AddressSP {
133
179
  addressStakingCredential?: null;
134
180
  addressCredential: AddressCredentialOrDatum;
135
181
  }
@@ -138,7 +184,7 @@ interface Input {
138
184
  index: number;
139
185
  }
140
186
  interface ScriptReference {
141
- output: Output;
187
+ output?: Output;
142
188
  input: Input;
143
189
  }
144
190
  interface AuthTokenPolicies {
@@ -151,45 +197,45 @@ interface AuthTokenPolicies {
151
197
  cdpAuthTokenRef: ScriptReference;
152
198
  accountTokenRef: ScriptReference;
153
199
  }
154
- interface PollShardParams {
200
+ interface PollShardParamsSP {
155
201
  stakingValHash: string;
156
- stakingToken: AssetClass;
157
- pollToken: AssetClass;
158
- indyAsset: AssetClass;
202
+ stakingToken: AssetClassSP;
203
+ pollToken: AssetClassSP;
204
+ indyAsset: AssetClassSP;
159
205
  }
160
- interface PollManagerParams {
161
- upgradeToken: AssetClass;
206
+ interface PollManagerParamsSP {
207
+ upgradeToken: AssetClassSP;
162
208
  treasuryValHash: string;
163
209
  shardsValHash: string;
164
- pollToken: AssetClass;
165
- pBiasTime: number;
166
- initialIndyDistribution: number;
167
- indyAsset: AssetClass;
168
- govNFT: AssetClass;
210
+ pollToken: AssetClassSP;
211
+ pBiasTime: bigint;
212
+ initialIndyDistribution: bigint;
213
+ indyAsset: AssetClassSP;
214
+ govNFT: AssetClassSP;
169
215
  govExecuteValHash: string;
170
216
  }
171
- interface GovParams {
172
- versionRecordToken: AssetClass;
173
- upgradeToken: AssetClass;
174
- pollToken: AssetClass;
217
+ interface GovParamsSP {
218
+ versionRecordToken: AssetClassSP;
219
+ upgradeToken: AssetClassSP;
220
+ pollToken: AssetClassSP;
175
221
  pollManagerValHash: string;
176
- indyAsset: AssetClass;
177
- iAssetAuthToken: AssetClass;
178
- govNFT: AssetClass;
179
- gBiasTime: number;
180
- daoIdentityToken: AssetClass;
222
+ indyAsset: AssetClassSP;
223
+ iAssetAuthToken: AssetClassSP;
224
+ govNFT: AssetClassSP;
225
+ gBiasTime: bigint;
226
+ daoIdentityToken: AssetClassSP;
181
227
  }
182
- interface ExecuteParams {
228
+ interface ExecuteParamsSP {
229
+ govNFT: AssetClassSP;
230
+ upgradeToken: AssetClassSP;
231
+ iAssetToken: AssetClassSP;
232
+ stabilityPoolToken: AssetClassSP;
233
+ versionRecordToken: AssetClassSP;
234
+ cdpValHash: string;
235
+ sPoolValHash: string;
183
236
  versionRegistryValHash: string;
184
- versionRecordToken: AssetClass;
185
- upgradeToken: AssetClass;
186
237
  treasuryValHash: string;
187
- stabilityPoolToken: AssetClass;
188
- sPoolValHash: string;
189
- maxInterestPeriods: number;
190
- iAssetToken: AssetClass;
191
- govNFT: AssetClass;
192
- cdpValHash: string;
238
+ indyAsset: AssetClassSP;
193
239
  }
194
240
  interface DistributionParams {
195
241
  treasuryIndyAmount: number;
@@ -197,96 +243,50 @@ interface DistributionParams {
197
243
  initialIndyDistribution: number;
198
244
  }
199
245
  interface CollectorParams {
200
- versionRecordToken: AssetClass;
201
- stakingToken: AssetClass;
202
- stakingManagerNFT: AssetClass;
246
+ versionRecordToken: AssetClassSP;
247
+ stakingToken: AssetClassSP;
248
+ stakingManagerNFT: AssetClassSP;
203
249
  }
204
250
  interface CdpParams {
205
- versionRecordToken: AssetClass;
206
- upgradeToken: AssetClass;
251
+ versionRecordToken: AssetClassSP;
252
+ upgradeToken: AssetClassSP;
207
253
  treasuryValHash: string;
208
- stabilityPoolAuthToken: AssetClass;
254
+ stabilityPoolAuthToken: AssetClassSP;
209
255
  spValHash: string;
210
256
  partialRedemptionExtraFeeLovelace: number;
211
257
  minCollateralInLovelace: number;
212
- iAssetAuthToken: AssetClass;
213
- govNFT: AssetClass;
258
+ iAssetAuthToken: AssetClassSP;
259
+ govNFT: AssetClassSP;
214
260
  collectorValHash: string;
215
- cdpAuthToken: AssetClass;
261
+ cdpAuthToken: AssetClassSP;
216
262
  cdpAssetSymbol: CurrencySymbol;
217
263
  biasTime: number;
218
264
  }
219
- interface CdpCreatorParams {
220
- versionRecordToken: AssetClass;
265
+ interface CDPCreatorParamsSP {
266
+ versionRecordToken: AssetClassSP;
221
267
  minCollateralInLovelace: number;
222
- iAssetAuthTk: AssetClass;
268
+ iAssetAuthTk: AssetClassSP;
223
269
  collectorValHash: string;
224
270
  cdpScriptHash: string;
225
- cdpCreatorNft: AssetClass;
226
- cdpAuthTk: AssetClass;
271
+ cdpCreatorNft: AssetClassSP;
272
+ cdpAuthTk: AssetClassSP;
227
273
  cdpAssetCs: CurrencySymbol;
228
- biasTime: number;
229
- }
230
-
231
- declare class CDPCreatorContract {
232
- static address(params: CdpCreatorParams, lucid: LucidEvolution): Address$1;
233
- static validator(params: CdpCreatorParams): SpendingValidator;
234
- static validatorHash(params: CdpCreatorParams): string;
235
- static redeemer(hash: Credential, mintedAmount: bigint, collateralAmount: bigint, currentTime: bigint): Data;
236
- static scriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
274
+ biasTime: bigint;
237
275
  }
238
-
239
- type ActiveCDPInterestTracking = {
240
- type: 'ActiveCDPInterestTracking';
241
- last_settled: bigint;
242
- unitary_interest_snapshot: bigint;
243
- };
244
- type FrozenCDPAccumulatedFees = {
245
- type: 'FrozenCDPAccumulatedFees';
246
- lovelaces_treasury: bigint;
247
- lovelaces_indy_stakers: bigint;
248
- };
249
- type CDPFees = ActiveCDPInterestTracking | FrozenCDPAccumulatedFees;
250
- type CDP = {
251
- type: 'CDP';
252
- owner: string | undefined;
253
- asset: string;
254
- mintedAmount: bigint;
255
- fees: CDPFees;
256
- };
257
- type IAsset = {
258
- type: 'IAsset';
259
- name: string;
260
- price: OnChainDecimal | AssetClass;
261
- interestOracle: AssetClass;
262
- redemptionRatioPercentage: OnChainDecimal;
263
- maintenanceRatioPercentage: OnChainDecimal;
264
- liquidationRatioPercentage: OnChainDecimal;
265
- debtMintingFeePercentage: OnChainDecimal;
266
- liquidationProcessingFeePercentage: OnChainDecimal;
267
- stabilityPoolWithdrawalFeePercentage: OnChainDecimal;
268
- redemptionReimbursementPercentage: OnChainDecimal;
269
- redemptionProcessingFeePercentage: OnChainDecimal;
270
- interestCollectorPortionPercentage: OnChainDecimal;
271
- firstAsset: boolean;
272
- nextAsset?: string;
273
- };
274
- type CDPDatum = CDP | IAsset;
276
+ declare function toSystemParamsAsset(asset: AssetClass): AssetClassSP;
277
+ declare function fromSystemParamsAsset(asset: AssetClassSP): AssetClass;
275
278
 
276
279
  declare class CDPContract {
277
- static openPosition(asset: string, collateralAmount: bigint, mintedAmount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, cdpCreatorRef?: OutRef, collectorRef?: OutRef): Promise<TxBuilder>;
280
+ static openPosition(asset: string, collateralAmount: bigint, mintedAmount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, cdpCreatorRef?: OutRef, collectorRef?: OutRef, now?: number): Promise<TxBuilder>;
278
281
  static deposit(cdpRef: OutRef, amount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
279
282
  static withdraw(cdpRef: OutRef, amount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
280
283
  static mint(cdpRef: OutRef, amount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
281
284
  static burn(cdpRef: OutRef, amount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
282
285
  static adjust(cdpRef: OutRef, collateralAmount: bigint, mintAmount: bigint, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
283
286
  static close(cdpRef: OutRef, params: SystemParams, lucid: LucidEvolution, assetRef?: OutRef, priceOracleRef?: OutRef, interestOracleRef?: OutRef, collectorRef?: OutRef, govRef?: OutRef, treasuryRef?: OutRef): Promise<TxBuilder>;
284
- static decodeCdpDatum(datum: string): CDPDatum;
285
- static encodeCdpDatum(datum: CDPDatum): string;
286
- static datum(hash: Credential, asset: string, mintedAmount: bigint, fees: CDPFees): Constr<Data>;
287
287
  static validator(params: CdpParams): SpendingValidator;
288
288
  static validatorHash(params: CdpParams): string;
289
- static address(cdpParams: CdpParams, lucid: LucidEvolution, skh?: Credential): string;
289
+ static address(cdpParams: CdpParams, lucid: LucidEvolution, skh?: Credential$1): string;
290
290
  static scriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
291
291
  static cdpAuthTokenRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
292
292
  static assetTokenRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
@@ -301,54 +301,56 @@ declare class CollectorContract {
301
301
  static scriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
302
302
  }
303
303
 
304
- type ProtocolParams = {
305
- proposalDeposit: bigint;
306
- votingPeriod: bigint;
307
- effectiveDelay: bigint;
308
- expirationPeriod: bigint;
309
- collateralFeePercentage: bigint;
310
- proposingPeriod: bigint;
311
- totalShards: bigint;
312
- minimumQuorum: bigint;
313
- maxTreasuryLovelaceSpend: bigint;
314
- maxTreasuryIndySpend: bigint;
315
- };
316
- type GovDatum = {
317
- currentProposal: bigint;
318
- protocolParams: ProtocolParams;
319
- currentVersion: bigint;
320
- iassetsCount: bigint;
321
- activeProposals: bigint;
322
- treasuryIndyWithdrawnAmt: bigint;
323
- };
324
-
325
304
  declare class GovContract {
326
- static decodeGovDatum(datum: string): GovDatum;
327
- static encodeGovDatum(datum: GovDatum): string;
328
305
  }
329
306
 
330
- type InterestOracleDatum = {
331
- unitaryInterest: bigint;
332
- interestRate: bigint;
333
- lastUpdated: bigint;
334
- };
307
+ declare class StabilityPoolContract {
308
+ static createAccount(asset: string, amount: bigint, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
309
+ static adjustAccount(asset: string, amount: bigint, accountUtxo: UTxO, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
310
+ static closeAccount(accountUtxo: UTxO, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
311
+ static processRequest(asset: string, stabilityPoolUtxo: UTxO, accountUtxo: UTxO, govUtxo: UTxO, iAssetUtxo: UTxO, newSnapshotUtxo: UTxO | undefined, params: SystemParams, lucid: LucidEvolution): Promise<TxBuilder>;
312
+ }
335
313
 
336
- declare class InterestOracleContract {
337
- static decodeInterestOracleDatum(datum: string): InterestOracleDatum;
338
- static encodeInterestOracleDatum(datum: InterestOracleDatum): string;
339
- static calculateUnitaryInterestSinceOracleLastUpdated(now: bigint, oracleDatum: InterestOracleDatum): bigint;
340
- static calculateUnitaryInterest(timePeriod: bigint, interestRate: bigint): bigint;
341
- static calculateAccruedInterest(now: bigint, unitaryInterestSnapshot: bigint, mintedAmount: bigint, interestLastSettled: bigint, interestOracleDatum: InterestOracleDatum): bigint;
314
+ declare class StakingContract {
315
+ static openPosition(amount: bigint, params: SystemParams, lucid: LucidEvolution, stakingManagerRef?: OutRef): Promise<TxBuilder>;
316
+ static adjustPosition(stakingPositionRef: OutRef, amount: bigint, params: SystemParams, lucid: LucidEvolution, stakingManagerRef?: OutRef): Promise<TxBuilder>;
317
+ static closePosition(stakingPositionRef: OutRef, params: SystemParams, lucid: LucidEvolution, stakingManagerRef?: OutRef): Promise<TxBuilder>;
318
+ static validator(params: StakingParams): SpendingValidator;
319
+ static validatorHash(params: StakingParams): string;
320
+ static address(params: StakingParams, lucid: LucidEvolution): Address$1;
321
+ static scriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
322
+ static stakingTokenScriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
342
323
  }
343
324
 
344
- type PriceOracleDatum = {
345
- price: bigint;
346
- expiration: bigint;
347
- };
325
+ declare const InterestOracleDatumSchema: _lucid_evolution_lucid.TObject<{
326
+ unitaryInterest: _lucid_evolution_lucid.TUnsafe<bigint>;
327
+ interestRate: _lucid_evolution_lucid.TObject<{
328
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
329
+ }>;
330
+ lastUpdated: _lucid_evolution_lucid.TUnsafe<bigint>;
331
+ }>;
332
+ type InterestOracleDatum = Data.Static<typeof InterestOracleDatumSchema>;
333
+ declare function parseInterestOracleDatum(datum: Datum): InterestOracleDatum;
334
+ declare function serialiseInterestOracleDatum(datum: InterestOracleDatum): Datum;
335
+ declare const FeedInterestOracleRedeemerSchema: _lucid_evolution_lucid.TObject<{
336
+ newInterestRate: _lucid_evolution_lucid.TObject<{
337
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
338
+ }>;
339
+ currentTime: _lucid_evolution_lucid.TUnsafe<bigint>;
340
+ }>;
341
+ type FeedInterestOracleRedeemer = Data.Static<typeof FeedInterestOracleRedeemerSchema>;
342
+ declare function serialiseFeedInterestOracleRedeemer(redeemer: FeedInterestOracleRedeemer): Datum;
343
+ declare const InterestOracleParamsSchema: _lucid_evolution_lucid.TObject<{
344
+ /** Milliseconds */
345
+ biasTime: _lucid_evolution_lucid.TUnsafe<bigint>;
346
+ owner: _lucid_evolution_lucid.TUnsafe<string>;
347
+ }>;
348
+ type InterestOracleParams = Data.Static<typeof InterestOracleParamsSchema>;
349
+ declare function castInterestOracleParams(params: InterestOracleParams): Data;
348
350
 
349
- declare class PriceOracleContract {
350
- static decodePriceOracleDatum(datum: string): PriceOracleDatum;
351
- static encodePriceOracleDatum(datum: PriceOracleDatum): string;
351
+ declare class InterestOracleContract {
352
+ static startInterestOracle(initialUnitaryInterest: bigint, initialInterestRate: bigint, initialLastInterestUpdate: bigint, oracleParams: InterestOracleParams, lucid: LucidEvolution, withScriptRef?: boolean, refOutRef?: OutRef, interestTokenName?: string): Promise<[TxBuilder, AssetClass]>;
353
+ static feedInterestOracle(params: InterestOracleParams, newInterestRate: bigint, lucid: LucidEvolution, assetClass?: AssetClass, utxo?: UTxO, scriptRef?: UTxO): Promise<TxBuilder>;
352
354
  }
353
355
 
354
356
  declare class TreasuryContract {
@@ -359,37 +361,235 @@ declare class TreasuryContract {
359
361
  static scriptRef(params: ScriptReferences, lucid: LucidEvolution): Promise<UTxO>;
360
362
  }
361
363
 
364
+ declare const CDPFeesSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
365
+ ActiveCDPInterestTracking: _lucid_evolution_lucid.TObject<{
366
+ lastSettled: _lucid_evolution_lucid.TUnsafe<bigint>;
367
+ unitaryInterestSnapshot: _lucid_evolution_lucid.TUnsafe<bigint>;
368
+ }>;
369
+ }> | _lucid_evolution_lucid.TObject<{
370
+ FrozenCDPAccumulatedFees: _lucid_evolution_lucid.TObject<{
371
+ lovelacesTreasury: _lucid_evolution_lucid.TUnsafe<bigint>;
372
+ lovelacesIndyStakers: _lucid_evolution_lucid.TUnsafe<bigint>;
373
+ }>;
374
+ }>)[]>;
375
+ declare const CDPContentSchema: _lucid_evolution_lucid.TObject<{
376
+ cdpOwner: _lucid_evolution_lucid.TUnsafe<string>;
377
+ iasset: _lucid_evolution_lucid.TUnsafe<string>;
378
+ mintedAmt: _lucid_evolution_lucid.TUnsafe<bigint>;
379
+ cdpFees: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
380
+ ActiveCDPInterestTracking: _lucid_evolution_lucid.TObject<{
381
+ lastSettled: _lucid_evolution_lucid.TUnsafe<bigint>;
382
+ unitaryInterestSnapshot: _lucid_evolution_lucid.TUnsafe<bigint>;
383
+ }>;
384
+ }> | _lucid_evolution_lucid.TObject<{
385
+ FrozenCDPAccumulatedFees: _lucid_evolution_lucid.TObject<{
386
+ lovelacesTreasury: _lucid_evolution_lucid.TUnsafe<bigint>;
387
+ lovelacesIndyStakers: _lucid_evolution_lucid.TUnsafe<bigint>;
388
+ }>;
389
+ }>)[]>;
390
+ }>;
391
+ declare const IAssetContentSchema: _lucid_evolution_lucid.TObject<{
392
+ /** Use the HEX encoding */
393
+ assetName: _lucid_evolution_lucid.TUnsafe<string>;
394
+ price: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
395
+ Delisted: _lucid_evolution_lucid.TObject<{
396
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
397
+ }>;
398
+ }> | _lucid_evolution_lucid.TObject<{
399
+ Oracle: _lucid_evolution_lucid.TObject<{
400
+ oracleNft: _lucid_evolution_lucid.TObject<{
401
+ asset: _lucid_evolution_lucid.TObject<{
402
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
403
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
404
+ }>;
405
+ }>;
406
+ }>;
407
+ }>)[]>;
408
+ interestOracleNft: _lucid_evolution_lucid.TObject<{
409
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
410
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
411
+ }>;
412
+ redemptionRatio: _lucid_evolution_lucid.TObject<{
413
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
414
+ }>;
415
+ maintenanceRatio: _lucid_evolution_lucid.TObject<{
416
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
417
+ }>;
418
+ liquidationRatio: _lucid_evolution_lucid.TObject<{
419
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
420
+ }>;
421
+ debtMintingFeePercentage: _lucid_evolution_lucid.TObject<{
422
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
423
+ }>;
424
+ liquidationProcessingFeePercentage: _lucid_evolution_lucid.TObject<{
425
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
426
+ }>;
427
+ stabilityPoolWithdrawalFeePercentage: _lucid_evolution_lucid.TObject<{
428
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
429
+ }>;
430
+ redemptionReimbursementPercentage: _lucid_evolution_lucid.TObject<{
431
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
432
+ }>;
433
+ redemptionProcessingFeePercentage: _lucid_evolution_lucid.TObject<{
434
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
435
+ }>;
436
+ interestCollectorPortionPercentage: _lucid_evolution_lucid.TObject<{
437
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
438
+ }>;
439
+ firstIAsset: _lucid_evolution_lucid.TUnsafe<boolean>;
440
+ nextIAsset: _lucid_evolution_lucid.TUnsafe<string>;
441
+ }>;
442
+ declare const CDPDatumSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
443
+ CDP: _lucid_evolution_lucid.TObject<{
444
+ content: _lucid_evolution_lucid.TObject<{
445
+ cdpOwner: _lucid_evolution_lucid.TUnsafe<string>;
446
+ iasset: _lucid_evolution_lucid.TUnsafe<string>;
447
+ mintedAmt: _lucid_evolution_lucid.TUnsafe<bigint>;
448
+ cdpFees: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
449
+ ActiveCDPInterestTracking: _lucid_evolution_lucid.TObject<{
450
+ lastSettled: _lucid_evolution_lucid.TUnsafe<bigint>;
451
+ unitaryInterestSnapshot: _lucid_evolution_lucid.TUnsafe<bigint>;
452
+ }>;
453
+ }> | _lucid_evolution_lucid.TObject<{
454
+ FrozenCDPAccumulatedFees: _lucid_evolution_lucid.TObject<{
455
+ lovelacesTreasury: _lucid_evolution_lucid.TUnsafe<bigint>;
456
+ lovelacesIndyStakers: _lucid_evolution_lucid.TUnsafe<bigint>;
457
+ }>;
458
+ }>)[]>;
459
+ }>;
460
+ }>;
461
+ }> | _lucid_evolution_lucid.TObject<{
462
+ IAsset: _lucid_evolution_lucid.TObject<{
463
+ content: _lucid_evolution_lucid.TObject<{
464
+ /** Use the HEX encoding */
465
+ assetName: _lucid_evolution_lucid.TUnsafe<string>;
466
+ price: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
467
+ Delisted: _lucid_evolution_lucid.TObject<{
468
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
469
+ }>;
470
+ }> | _lucid_evolution_lucid.TObject<{
471
+ Oracle: _lucid_evolution_lucid.TObject<{
472
+ oracleNft: _lucid_evolution_lucid.TObject<{
473
+ asset: _lucid_evolution_lucid.TObject<{
474
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
475
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
476
+ }>;
477
+ }>;
478
+ }>;
479
+ }>)[]>;
480
+ interestOracleNft: _lucid_evolution_lucid.TObject<{
481
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
482
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
483
+ }>;
484
+ redemptionRatio: _lucid_evolution_lucid.TObject<{
485
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
486
+ }>;
487
+ maintenanceRatio: _lucid_evolution_lucid.TObject<{
488
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
489
+ }>;
490
+ liquidationRatio: _lucid_evolution_lucid.TObject<{
491
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
492
+ }>;
493
+ debtMintingFeePercentage: _lucid_evolution_lucid.TObject<{
494
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
495
+ }>;
496
+ liquidationProcessingFeePercentage: _lucid_evolution_lucid.TObject<{
497
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
498
+ }>;
499
+ stabilityPoolWithdrawalFeePercentage: _lucid_evolution_lucid.TObject<{
500
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
501
+ }>;
502
+ redemptionReimbursementPercentage: _lucid_evolution_lucid.TObject<{
503
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
504
+ }>;
505
+ redemptionProcessingFeePercentage: _lucid_evolution_lucid.TObject<{
506
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
507
+ }>;
508
+ interestCollectorPortionPercentage: _lucid_evolution_lucid.TObject<{
509
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
510
+ }>;
511
+ firstIAsset: _lucid_evolution_lucid.TUnsafe<boolean>;
512
+ nextIAsset: _lucid_evolution_lucid.TUnsafe<string>;
513
+ }>;
514
+ }>;
515
+ }>)[]>;
516
+ type CDPFees = Data.Static<typeof CDPFeesSchema>;
517
+ type CDPDatum = Data.Static<typeof CDPDatumSchema>;
518
+ type CDPContent = Data.Static<typeof CDPContentSchema>;
519
+ type IAssetContent = Data.Static<typeof IAssetContentSchema>;
520
+ declare function parseCDPDatum(datum: Datum): CDPContent;
521
+ declare function serialiseCDPDatum(cdpDatum: CDPContent): Datum;
522
+ declare function parseIAssetDatum(datum: Datum): IAssetContent;
523
+ declare function serialiseIAssetDatum(iassetDatum: IAssetContent): Datum;
524
+
362
525
  type IAssetOutput = {
363
526
  utxo: UTxO;
364
- datum: IAsset;
527
+ datum: IAssetContent;
365
528
  };
366
529
  declare class IAssetHelpers {
367
- static findIAssetByRef(outRef: OutRef, params: SystemParams, lucid: LucidEvolution): Promise<IAssetOutput>;
530
+ static findIAssetByRef(outRef: OutRef, lucid: LucidEvolution): Promise<IAssetOutput>;
368
531
  static findIAssetByName(assetName: string, params: SystemParams, lucid: LucidEvolution): Promise<IAssetOutput>;
369
532
  }
370
533
 
371
- declare class CDPHelpers {
372
- static cdps(params: SystemParams, lucid: LucidEvolution): Promise<UTxO[]>;
373
- }
374
-
534
+ /**
535
+ * Accept only a single item in the array and return it.
536
+ * When not exclusively a single item, throw an error.
537
+ */
538
+ declare function matchSingle<T>(xs: T[], mkErr: (xs: T[]) => Error): T;
375
539
  declare function calculateFeeFromPercentage(percent: bigint, amount: bigint): bigint;
376
540
  declare function loadSystemParamsFromFile(file: string): SystemParams;
377
541
  declare function loadSystemParamsFromUrl(url: string): Promise<SystemParams>;
542
+ declare const getRandomElement: <T>(arr: T[]) => T;
378
543
 
379
- declare function addrDetails(lucid: LucidEvolution): Promise<[Credential, Credential | undefined]>;
544
+ /**
545
+ * Returns the inline datum.
546
+ * Throws when the UTXO doesn't have an inline datum
547
+ * (i.e. in case it has hash datum or no datum).
548
+ */
549
+ declare function getInlineDatumOrThrow(utxo: UTxO): Datum;
550
+ declare function addrDetails(lucid: LucidEvolution): Promise<[Credential$1, Credential$1 | undefined]>;
551
+ declare function createScriptAddress(network: Network, scriptHash: ScriptHash, stakeCredential?: Credential$1): Address$1;
380
552
  declare function scriptRef(ref: ScriptReference, lucid: LucidEvolution): Promise<UTxO>;
381
553
  declare function balance(utxos: UTxO[]): Assets;
382
- declare const getRandomElement: (arr: any[]) => any;
383
554
 
555
+ declare const ONE_SECOND: number;
384
556
  declare const oneHour: bigint;
385
557
  declare const oneDay: bigint;
386
558
  declare const oneYear: bigint;
387
559
 
388
- declare const _cdpCreatorValidator: {
560
+ declare const CDPCreatorParamsSchema: _lucid_evolution_lucid.TObject<{
561
+ cdpCreatorNft: _lucid_evolution_lucid.TObject<{
562
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
563
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
564
+ }>;
565
+ cdpAssetCs: _lucid_evolution_lucid.TUnsafe<string>;
566
+ cdpAuthTk: _lucid_evolution_lucid.TObject<{
567
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
568
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
569
+ }>;
570
+ iAssetAuthTk: _lucid_evolution_lucid.TObject<{
571
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
572
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
573
+ }>;
574
+ versionRecordToken: _lucid_evolution_lucid.TObject<{
575
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
576
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
577
+ }>;
578
+ cdpScriptHash: _lucid_evolution_lucid.TUnsafe<string>;
579
+ collectorValHash: _lucid_evolution_lucid.TUnsafe<string>;
580
+ minCollateralInLovelace: _lucid_evolution_lucid.TUnsafe<bigint>;
581
+ biasTime: _lucid_evolution_lucid.TUnsafe<bigint>;
582
+ }>;
583
+ type CDPCreatorParams = Data.Static<typeof CDPCreatorParamsSchema>;
584
+ declare const CDPCreatorParams: CDPCreatorParams;
585
+
586
+ declare const cdpCreatorValidator: {
389
587
  type: ScriptType;
390
588
  description: string;
391
589
  cborHex: string;
392
590
  };
591
+ declare const mkCDPCreatorValidator: (params: CDPCreatorParams) => SpendingValidator;
592
+ declare const mkCDPCreatorValidatorFromSP: (params: CDPCreatorParamsSP) => SpendingValidator;
393
593
 
394
594
  declare const _cdpValidator: {
395
595
  type: ScriptType;
@@ -403,11 +603,59 @@ declare const _collectorValidator: {
403
603
  cborHex: string;
404
604
  };
405
605
 
406
- declare const _interestOracleValidator: {
407
- type: ScriptType;
408
- description: string;
409
- cborHex: string;
410
- };
606
+ declare function mkInterestOracleValidator(params: InterestOracleParams): SpendingValidator;
607
+
608
+ declare const PollShardParamsSchema: _lucid_evolution_lucid.TObject<{
609
+ pollToken: _lucid_evolution_lucid.TObject<{
610
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
611
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
612
+ }>;
613
+ stakingToken: _lucid_evolution_lucid.TObject<{
614
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
615
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
616
+ }>;
617
+ indyAsset: _lucid_evolution_lucid.TObject<{
618
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
619
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
620
+ }>;
621
+ stakingValHash: _lucid_evolution_lucid.TUnsafe<string>;
622
+ }>;
623
+ type PollShardParams = Data.Static<typeof PollShardParamsSchema>;
624
+ declare const PollShardParams: PollShardParams;
625
+ declare function castPollShardParams(params: PollShardParams): Data;
626
+
627
+ declare const mkPollShardValidator: (params: PollShardParams) => SpendingValidator;
628
+ declare const mkPollShardValidatorFromSP: (params: PollShardParamsSP) => SpendingValidator;
629
+
630
+ declare const PollManagerParamsSchema: _lucid_evolution_lucid.TObject<{
631
+ govNFT: _lucid_evolution_lucid.TObject<{
632
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
633
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
634
+ }>;
635
+ pollToken: _lucid_evolution_lucid.TObject<{
636
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
637
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
638
+ }>;
639
+ upgradeToken: _lucid_evolution_lucid.TObject<{
640
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
641
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
642
+ }>;
643
+ indyAsset: _lucid_evolution_lucid.TObject<{
644
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
645
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
646
+ }>;
647
+ govExecuteValHash: _lucid_evolution_lucid.TUnsafe<string>;
648
+ pBiasTime: _lucid_evolution_lucid.TUnsafe<bigint>;
649
+ shardValHash: _lucid_evolution_lucid.TUnsafe<string>;
650
+ treasuryValHash: _lucid_evolution_lucid.TUnsafe<string>;
651
+ initialIndyDistribution: _lucid_evolution_lucid.TUnsafe<bigint>;
652
+ }>;
653
+ type PollManagerParams = Data.Static<typeof PollManagerParamsSchema>;
654
+ declare const PollManagerParams: PollManagerParams;
655
+ declare function castPollManagerParams(params: PollManagerParams): Data;
656
+
657
+ declare const mkPollManagerValidator: (params: PollManagerParams) => SpendingValidator;
658
+ declare const mkPollManagerValidatorFromSP: (params: PollManagerParamsSP) => SpendingValidator;
411
659
 
412
660
  declare const _treasuryValidator: {
413
661
  type: ScriptType;
@@ -415,4 +663,638 @@ declare const _treasuryValidator: {
415
663
  cborHex: string;
416
664
  };
417
665
 
418
- export { type ActiveCDPInterestTracking, type Address, type AddressCredential, type AddressCredentialOrDatum, type Amount, type AssetClass, type AuthTokenPolicies, type CDP, CDPContract, CDPCreatorContract, type CDPDatum, type CDPFees, CDPHelpers, type CdpCreatorParams, type CdpParams, CollectorContract, type CollectorParams, type CurrencySymbol, type DistributionParams, type ExecuteParams, type FrozenCDPAccumulatedFees, GovContract, type GovDatum, type GovParams, type IAsset, IAssetHelpers, type IAssetOutput, type Input, InterestOracleContract, type InterestOracleDatum, type OnChainDecimal, type Output, type PollManagerParams, type PollShardParams, PriceOracleContract, type PriceOracleDatum, type ProtocolParams, type PubKeyHash, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, type StabilityPoolParams, type StakingParams, type StartTime, type SystemParams, type TokenName, TreasuryContract, type TreasuryParams, type ValidatorHashes, type VersionRecordParams, _cdpCreatorValidator, _cdpValidator, _collectorValidator, _interestOracleValidator, _treasuryValidator, addrDetails, balance, calculateFeeFromPercentage, getRandomElement, loadSystemParamsFromFile, loadSystemParamsFromUrl, oneDay, oneHour, oneYear, scriptRef };
666
+ declare const ExecuteParamsSchema: _lucid_evolution_lucid.TObject<{
667
+ govNFT: _lucid_evolution_lucid.TObject<{
668
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
669
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
670
+ }>;
671
+ upgradeToken: _lucid_evolution_lucid.TObject<{
672
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
673
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
674
+ }>;
675
+ iAssetToken: _lucid_evolution_lucid.TObject<{
676
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
677
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
678
+ }>;
679
+ stabilityPoolToken: _lucid_evolution_lucid.TObject<{
680
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
681
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
682
+ }>;
683
+ versionRecordToken: _lucid_evolution_lucid.TObject<{
684
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
685
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
686
+ }>;
687
+ cdpValHash: _lucid_evolution_lucid.TUnsafe<string>;
688
+ sPoolValHash: _lucid_evolution_lucid.TUnsafe<string>;
689
+ versionRegistryValHash: _lucid_evolution_lucid.TUnsafe<string>;
690
+ treasuryValHash: _lucid_evolution_lucid.TUnsafe<string>;
691
+ indyAsset: _lucid_evolution_lucid.TObject<{
692
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
693
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
694
+ }>;
695
+ }>;
696
+ type ExecuteParams = Data.Static<typeof ExecuteParamsSchema>;
697
+ declare const ExecuteParams: ExecuteParams;
698
+ declare function castExecuteParams(params: ExecuteParams): Data;
699
+
700
+ declare const GovDatumSchema: _lucid_evolution_lucid.TObject<{
701
+ currentProposal: _lucid_evolution_lucid.TUnsafe<bigint>;
702
+ protocolParams: _lucid_evolution_lucid.TObject<{
703
+ proposalDeposit: _lucid_evolution_lucid.TUnsafe<bigint>;
704
+ votingPeriod: _lucid_evolution_lucid.TUnsafe<bigint>;
705
+ effectiveDelay: _lucid_evolution_lucid.TUnsafe<bigint>;
706
+ expirationPeriod: _lucid_evolution_lucid.TUnsafe<bigint>;
707
+ collateralFeePercentage: _lucid_evolution_lucid.TObject<{
708
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
709
+ }>;
710
+ proposingPeriod: _lucid_evolution_lucid.TUnsafe<bigint>;
711
+ totalShards: _lucid_evolution_lucid.TUnsafe<bigint>;
712
+ minimumQuorum: _lucid_evolution_lucid.TUnsafe<bigint>;
713
+ maxTreasuryLovelaceSpend: _lucid_evolution_lucid.TUnsafe<bigint>;
714
+ maxTreasuryIndySpend: _lucid_evolution_lucid.TUnsafe<bigint>;
715
+ }>;
716
+ currentVersion: _lucid_evolution_lucid.TUnsafe<bigint>;
717
+ iassetsCount: _lucid_evolution_lucid.TUnsafe<bigint>;
718
+ activeProposals: _lucid_evolution_lucid.TUnsafe<bigint>;
719
+ treasuryIndyWithdrawnAmt: _lucid_evolution_lucid.TUnsafe<bigint>;
720
+ }>;
721
+ type GovDatum = Data.Static<typeof GovDatumSchema>;
722
+ declare function parseGovDatum(datum: Datum): GovDatum;
723
+ declare function serialiseGovDatum(d: GovDatum): Datum;
724
+ declare const GovParamsSchema: _lucid_evolution_lucid.TObject<{
725
+ govNFT: _lucid_evolution_lucid.TObject<{
726
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
727
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
728
+ }>;
729
+ pollToken: _lucid_evolution_lucid.TObject<{
730
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
731
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
732
+ }>;
733
+ upgradeToken: _lucid_evolution_lucid.TObject<{
734
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
735
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
736
+ }>;
737
+ indyAsset: _lucid_evolution_lucid.TObject<{
738
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
739
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
740
+ }>;
741
+ versionRecordToken: _lucid_evolution_lucid.TObject<{
742
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
743
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
744
+ }>;
745
+ pollManagerValHash: _lucid_evolution_lucid.TUnsafe<string>;
746
+ gBiasTime: _lucid_evolution_lucid.TUnsafe<bigint>;
747
+ daoIdentityToken: _lucid_evolution_lucid.TObject<{
748
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
749
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
750
+ }>;
751
+ iAssetAuthToken: _lucid_evolution_lucid.TObject<{
752
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
753
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
754
+ }>;
755
+ }>;
756
+ type GovParams = Data.Static<typeof GovParamsSchema>;
757
+ declare const GovParams: GovParams;
758
+ declare function castGovParams(params: GovParams): Data;
759
+
760
+ declare const OracleAssetNftSchema: _lucid_evolution_lucid.TObject<{
761
+ oracleNft: _lucid_evolution_lucid.TObject<{
762
+ asset: _lucid_evolution_lucid.TObject<{
763
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
764
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
765
+ }>;
766
+ }>;
767
+ }>;
768
+ type OracleAssetNft = Data.Static<typeof OracleAssetNftSchema>;
769
+ declare const PriceOracleParamsSchema: _lucid_evolution_lucid.TObject<{
770
+ owner: _lucid_evolution_lucid.TUnsafe<string>;
771
+ /** Milliseconds */
772
+ biasTime: _lucid_evolution_lucid.TUnsafe<bigint>;
773
+ /** Milliseconds */
774
+ expiration: _lucid_evolution_lucid.TUnsafe<bigint>;
775
+ }>;
776
+ type PriceOracleParams = Data.Static<typeof PriceOracleParamsSchema>;
777
+ declare const PriceOracleDatumSchema: _lucid_evolution_lucid.TObject<{
778
+ price: _lucid_evolution_lucid.TObject<{
779
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
780
+ }>;
781
+ expiration: _lucid_evolution_lucid.TUnsafe<bigint>;
782
+ }>;
783
+ type PriceOracleDatum = Data.Static<typeof PriceOracleDatumSchema>;
784
+ declare function parsePriceOracleDatum(datum: Datum): PriceOracleDatum;
785
+ declare function serialisePriceOracleDatum(datum: PriceOracleDatum): Datum;
786
+ declare function castPriceOracleParams(params: PriceOracleParams): Data;
787
+
788
+ declare const SPIntegerSchema: _lucid_evolution_lucid.TObject<{
789
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
790
+ }>;
791
+ type SPInteger = Data.Static<typeof SPIntegerSchema>;
792
+ declare const SPInteger: SPInteger;
793
+ declare const StabilityPoolSnapshotSchema: _lucid_evolution_lucid.TObject<{
794
+ productVal: _lucid_evolution_lucid.TObject<{
795
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
796
+ }>;
797
+ depositVal: _lucid_evolution_lucid.TObject<{
798
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
799
+ }>;
800
+ sumVal: _lucid_evolution_lucid.TObject<{
801
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
802
+ }>;
803
+ epoch: _lucid_evolution_lucid.TUnsafe<bigint>;
804
+ scale: _lucid_evolution_lucid.TUnsafe<bigint>;
805
+ }>;
806
+ type StabilityPoolSnapshot = Data.Static<typeof StabilityPoolSnapshotSchema>;
807
+ declare const StabilityPoolSnapshot: StabilityPoolSnapshot;
808
+ declare const EpochToScaleToSumSchema: _lucid_evolution_lucid.TUnsafe<Map<{
809
+ epoch: bigint;
810
+ scale: bigint;
811
+ }, {
812
+ value: bigint;
813
+ }>>;
814
+ type EpochToScaleToSum = Data.Static<typeof EpochToScaleToSumSchema>;
815
+ declare const EpochToScaleToSum: EpochToScaleToSum;
816
+ declare const StabilityPoolContentSchema: _lucid_evolution_lucid.TObject<{
817
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
818
+ snapshot: _lucid_evolution_lucid.TObject<{
819
+ productVal: _lucid_evolution_lucid.TObject<{
820
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
821
+ }>;
822
+ depositVal: _lucid_evolution_lucid.TObject<{
823
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
824
+ }>;
825
+ sumVal: _lucid_evolution_lucid.TObject<{
826
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
827
+ }>;
828
+ epoch: _lucid_evolution_lucid.TUnsafe<bigint>;
829
+ scale: _lucid_evolution_lucid.TUnsafe<bigint>;
830
+ }>;
831
+ epochToScaleToSum: _lucid_evolution_lucid.TUnsafe<Map<{
832
+ epoch: bigint;
833
+ scale: bigint;
834
+ }, {
835
+ value: bigint;
836
+ }>>;
837
+ }>;
838
+ type StabilityPoolContent = Data.Static<typeof StabilityPoolContentSchema>;
839
+ declare const StabilityPoolContent: StabilityPoolContent;
840
+ declare const AccountActionSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TLiteral<"Create"> | _lucid_evolution_lucid.TObject<{
841
+ Adjust: _lucid_evolution_lucid.TObject<{
842
+ amount: _lucid_evolution_lucid.TUnsafe<bigint>;
843
+ outputAddress: _lucid_evolution_lucid.TObject<{
844
+ paymentCredential: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
845
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
846
+ }> | _lucid_evolution_lucid.TObject<{
847
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
848
+ }>)[]>;
849
+ stakeCredential: _lucid_evolution_lucid.TUnsafe<{
850
+ Inline: [{
851
+ PublicKeyCredential: [string];
852
+ } | {
853
+ ScriptCredential: [string];
854
+ }];
855
+ } | {
856
+ Pointer: [{
857
+ slotNumber: bigint;
858
+ transactionIndex: bigint;
859
+ certificateIndex: bigint;
860
+ }];
861
+ }>;
862
+ }>;
863
+ }>;
864
+ }> | _lucid_evolution_lucid.TObject<{
865
+ Close: _lucid_evolution_lucid.TObject<{
866
+ outputAddress: _lucid_evolution_lucid.TObject<{
867
+ paymentCredential: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
868
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
869
+ }> | _lucid_evolution_lucid.TObject<{
870
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
871
+ }>)[]>;
872
+ stakeCredential: _lucid_evolution_lucid.TUnsafe<{
873
+ Inline: [{
874
+ PublicKeyCredential: [string];
875
+ } | {
876
+ ScriptCredential: [string];
877
+ }];
878
+ } | {
879
+ Pointer: [{
880
+ slotNumber: bigint;
881
+ transactionIndex: bigint;
882
+ certificateIndex: bigint;
883
+ }];
884
+ }>;
885
+ }>;
886
+ }>;
887
+ }>)[]>;
888
+ type AccountAction = Data.Static<typeof AccountActionSchema>;
889
+ declare const AccountAction: AccountAction;
890
+ declare const AccountContentSchema: _lucid_evolution_lucid.TObject<{
891
+ owner: _lucid_evolution_lucid.TUnsafe<string>;
892
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
893
+ snapshot: _lucid_evolution_lucid.TObject<{
894
+ productVal: _lucid_evolution_lucid.TObject<{
895
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
896
+ }>;
897
+ depositVal: _lucid_evolution_lucid.TObject<{
898
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
899
+ }>;
900
+ sumVal: _lucid_evolution_lucid.TObject<{
901
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
902
+ }>;
903
+ epoch: _lucid_evolution_lucid.TUnsafe<bigint>;
904
+ scale: _lucid_evolution_lucid.TUnsafe<bigint>;
905
+ }>;
906
+ request: _lucid_evolution_lucid.TUnsafe<"Create" | {
907
+ Adjust: {
908
+ amount: bigint;
909
+ outputAddress: {
910
+ paymentCredential: {
911
+ PublicKeyCredential: [string];
912
+ } | {
913
+ ScriptCredential: [string];
914
+ };
915
+ stakeCredential: {
916
+ Inline: [{
917
+ PublicKeyCredential: [string];
918
+ } | {
919
+ ScriptCredential: [string];
920
+ }];
921
+ } | {
922
+ Pointer: [{
923
+ slotNumber: bigint;
924
+ transactionIndex: bigint;
925
+ certificateIndex: bigint;
926
+ }];
927
+ };
928
+ };
929
+ };
930
+ } | {
931
+ Close: {
932
+ outputAddress: {
933
+ paymentCredential: {
934
+ PublicKeyCredential: [string];
935
+ } | {
936
+ ScriptCredential: [string];
937
+ };
938
+ stakeCredential: {
939
+ Inline: [{
940
+ PublicKeyCredential: [string];
941
+ } | {
942
+ ScriptCredential: [string];
943
+ }];
944
+ } | {
945
+ Pointer: [{
946
+ slotNumber: bigint;
947
+ transactionIndex: bigint;
948
+ certificateIndex: bigint;
949
+ }];
950
+ };
951
+ };
952
+ };
953
+ }>;
954
+ }>;
955
+ type AccountContent = Data.Static<typeof AccountContentSchema>;
956
+ declare const AccountContent: AccountContent;
957
+ declare const SnapshotEpochToScaleToSumContentSchema: _lucid_evolution_lucid.TObject<{
958
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
959
+ snapshot: _lucid_evolution_lucid.TUnsafe<Map<{
960
+ epoch: bigint;
961
+ scale: bigint;
962
+ }, {
963
+ value: bigint;
964
+ }>>;
965
+ }>;
966
+ type SnapshotEpochToScaleToSumContent = Data.Static<typeof SnapshotEpochToScaleToSumContentSchema>;
967
+ declare const SnapshotEpochToScaleToSumContent: SnapshotEpochToScaleToSumContent;
968
+ declare const StabilityPoolDatumSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
969
+ StabilityPool: _lucid_evolution_lucid.TObject<{
970
+ content: _lucid_evolution_lucid.TObject<{
971
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
972
+ snapshot: _lucid_evolution_lucid.TObject<{
973
+ productVal: _lucid_evolution_lucid.TObject<{
974
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
975
+ }>;
976
+ depositVal: _lucid_evolution_lucid.TObject<{
977
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
978
+ }>;
979
+ sumVal: _lucid_evolution_lucid.TObject<{
980
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
981
+ }>;
982
+ epoch: _lucid_evolution_lucid.TUnsafe<bigint>;
983
+ scale: _lucid_evolution_lucid.TUnsafe<bigint>;
984
+ }>;
985
+ epochToScaleToSum: _lucid_evolution_lucid.TUnsafe<Map<{
986
+ epoch: bigint;
987
+ scale: bigint;
988
+ }, {
989
+ value: bigint;
990
+ }>>;
991
+ }>;
992
+ }>;
993
+ }> | _lucid_evolution_lucid.TObject<{
994
+ Account: _lucid_evolution_lucid.TObject<{
995
+ content: _lucid_evolution_lucid.TObject<{
996
+ owner: _lucid_evolution_lucid.TUnsafe<string>;
997
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
998
+ snapshot: _lucid_evolution_lucid.TObject<{
999
+ productVal: _lucid_evolution_lucid.TObject<{
1000
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
1001
+ }>;
1002
+ depositVal: _lucid_evolution_lucid.TObject<{
1003
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
1004
+ }>;
1005
+ sumVal: _lucid_evolution_lucid.TObject<{
1006
+ value: _lucid_evolution_lucid.TUnsafe<bigint>;
1007
+ }>;
1008
+ epoch: _lucid_evolution_lucid.TUnsafe<bigint>;
1009
+ scale: _lucid_evolution_lucid.TUnsafe<bigint>;
1010
+ }>;
1011
+ request: _lucid_evolution_lucid.TUnsafe<"Create" | {
1012
+ Adjust: {
1013
+ amount: bigint;
1014
+ outputAddress: {
1015
+ paymentCredential: {
1016
+ PublicKeyCredential: [string];
1017
+ } | {
1018
+ ScriptCredential: [string];
1019
+ };
1020
+ stakeCredential: {
1021
+ Inline: [{
1022
+ PublicKeyCredential: [string];
1023
+ } | {
1024
+ ScriptCredential: [string];
1025
+ }];
1026
+ } | {
1027
+ Pointer: [{
1028
+ slotNumber: bigint;
1029
+ transactionIndex: bigint;
1030
+ certificateIndex: bigint;
1031
+ }];
1032
+ };
1033
+ };
1034
+ };
1035
+ } | {
1036
+ Close: {
1037
+ outputAddress: {
1038
+ paymentCredential: {
1039
+ PublicKeyCredential: [string];
1040
+ } | {
1041
+ ScriptCredential: [string];
1042
+ };
1043
+ stakeCredential: {
1044
+ Inline: [{
1045
+ PublicKeyCredential: [string];
1046
+ } | {
1047
+ ScriptCredential: [string];
1048
+ }];
1049
+ } | {
1050
+ Pointer: [{
1051
+ slotNumber: bigint;
1052
+ transactionIndex: bigint;
1053
+ certificateIndex: bigint;
1054
+ }];
1055
+ };
1056
+ };
1057
+ };
1058
+ }>;
1059
+ }>;
1060
+ }>;
1061
+ }> | _lucid_evolution_lucid.TObject<{
1062
+ SnapshotEpochToScaleToSum: _lucid_evolution_lucid.TObject<{
1063
+ content: _lucid_evolution_lucid.TObject<{
1064
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
1065
+ snapshot: _lucid_evolution_lucid.TUnsafe<Map<{
1066
+ epoch: bigint;
1067
+ scale: bigint;
1068
+ }, {
1069
+ value: bigint;
1070
+ }>>;
1071
+ }>;
1072
+ }>;
1073
+ }>)[]>;
1074
+ type StabilityPoolDatum = Data.Static<typeof StabilityPoolDatumSchema>;
1075
+ declare const StabilityPoolDatum: StabilityPoolDatum;
1076
+ declare const ActionReturnDatumSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
1077
+ IndigoStabilityPoolAccountAdjustment: _lucid_evolution_lucid.TObject<{
1078
+ spent_account: _lucid_evolution_lucid.TObject<{
1079
+ txHash: _lucid_evolution_lucid.TObject<{
1080
+ hash: _lucid_evolution_lucid.TUnsafe<string>;
1081
+ }>;
1082
+ outputIndex: _lucid_evolution_lucid.TUnsafe<bigint>;
1083
+ }>;
1084
+ }>;
1085
+ }> | _lucid_evolution_lucid.TObject<{
1086
+ IndigoStabilityPoolAccountClosure: _lucid_evolution_lucid.TObject<{
1087
+ closed_account: _lucid_evolution_lucid.TObject<{
1088
+ txHash: _lucid_evolution_lucid.TObject<{
1089
+ hash: _lucid_evolution_lucid.TUnsafe<string>;
1090
+ }>;
1091
+ outputIndex: _lucid_evolution_lucid.TUnsafe<bigint>;
1092
+ }>;
1093
+ }>;
1094
+ }>)[]>;
1095
+ type ActionReturnDatum = Data.Static<typeof ActionReturnDatumSchema>;
1096
+ declare const ActionReturnDatum: ActionReturnDatum;
1097
+ declare const StabilityPoolRedeemerSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
1098
+ RequestAction: _lucid_evolution_lucid.TObject<{
1099
+ action: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TLiteral<"Create"> | _lucid_evolution_lucid.TObject<{
1100
+ Adjust: _lucid_evolution_lucid.TObject<{
1101
+ amount: _lucid_evolution_lucid.TUnsafe<bigint>;
1102
+ outputAddress: _lucid_evolution_lucid.TObject<{
1103
+ paymentCredential: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
1104
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
1105
+ }> | _lucid_evolution_lucid.TObject<{
1106
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
1107
+ }>)[]>;
1108
+ stakeCredential: _lucid_evolution_lucid.TUnsafe<{
1109
+ Inline: [{
1110
+ PublicKeyCredential: [string];
1111
+ } | {
1112
+ ScriptCredential: [string];
1113
+ }];
1114
+ } | {
1115
+ Pointer: [{
1116
+ slotNumber: bigint;
1117
+ transactionIndex: bigint;
1118
+ certificateIndex: bigint;
1119
+ }];
1120
+ }>;
1121
+ }>;
1122
+ }>;
1123
+ }> | _lucid_evolution_lucid.TObject<{
1124
+ Close: _lucid_evolution_lucid.TObject<{
1125
+ outputAddress: _lucid_evolution_lucid.TObject<{
1126
+ paymentCredential: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TObject<{
1127
+ PublicKeyCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
1128
+ }> | _lucid_evolution_lucid.TObject<{
1129
+ ScriptCredential: _lucid_evolution_lucid.TTuple<[_lucid_evolution_lucid.TUnsafe<string>]>;
1130
+ }>)[]>;
1131
+ stakeCredential: _lucid_evolution_lucid.TUnsafe<{
1132
+ Inline: [{
1133
+ PublicKeyCredential: [string];
1134
+ } | {
1135
+ ScriptCredential: [string];
1136
+ }];
1137
+ } | {
1138
+ Pointer: [{
1139
+ slotNumber: bigint;
1140
+ transactionIndex: bigint;
1141
+ certificateIndex: bigint;
1142
+ }];
1143
+ }>;
1144
+ }>;
1145
+ }>;
1146
+ }>)[]>;
1147
+ }>;
1148
+ }> | _lucid_evolution_lucid.TObject<{
1149
+ ProcessRequest: _lucid_evolution_lucid.TObject<{
1150
+ requestRef: _lucid_evolution_lucid.TObject<{
1151
+ txHash: _lucid_evolution_lucid.TObject<{
1152
+ hash: _lucid_evolution_lucid.TUnsafe<string>;
1153
+ }>;
1154
+ outputIndex: _lucid_evolution_lucid.TUnsafe<bigint>;
1155
+ }>;
1156
+ }>;
1157
+ }> | _lucid_evolution_lucid.TObject<{
1158
+ AnnulRequest: _lucid_evolution_lucid.TObject<{}>;
1159
+ }> | _lucid_evolution_lucid.TObject<{
1160
+ LiquidateCDP: _lucid_evolution_lucid.TObject<{}>;
1161
+ }> | _lucid_evolution_lucid.TObject<{
1162
+ RecordEpochToScaleToSum: _lucid_evolution_lucid.TObject<{}>;
1163
+ }> | _lucid_evolution_lucid.TObject<{
1164
+ UpgradeVersion: _lucid_evolution_lucid.TObject<{}>;
1165
+ }>)[]>;
1166
+ type StabilityPoolRedeemer = Data.Static<typeof StabilityPoolRedeemerSchema>;
1167
+ declare const StabilityPoolRedeemer: StabilityPoolRedeemer;
1168
+ declare function parseStabilityPoolDatum(datum: Datum): StabilityPoolContent;
1169
+ declare function parseAccountDatum(datum: Datum): AccountContent;
1170
+ declare function parseSnapshotEpochToScaleToSumDatum(datum: Datum): SnapshotEpochToScaleToSumContent;
1171
+ declare function serialiseStabilityPoolDatum(d: StabilityPoolDatum): Datum;
1172
+ declare function serialiseStabilityPoolRedeemer(params: StabilityPoolRedeemer): string;
1173
+ /** SP Parameters */
1174
+ declare const StabilityPoolParamsSchema: _lucid_evolution_lucid.TObject<{
1175
+ assetSymbol: _lucid_evolution_lucid.TUnsafe<string>;
1176
+ stabilityPoolToken: _lucid_evolution_lucid.TObject<{
1177
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1178
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1179
+ }>;
1180
+ snapshotEpochToScaleToSumToken: _lucid_evolution_lucid.TObject<{
1181
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1182
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1183
+ }>;
1184
+ accountToken: _lucid_evolution_lucid.TObject<{
1185
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1186
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1187
+ }>;
1188
+ cdpToken: _lucid_evolution_lucid.TObject<{
1189
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1190
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1191
+ }>;
1192
+ iAssetAuthToken: _lucid_evolution_lucid.TObject<{
1193
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1194
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1195
+ }>;
1196
+ versionRecordToken: _lucid_evolution_lucid.TObject<{
1197
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1198
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1199
+ }>;
1200
+ collectorValHash: _lucid_evolution_lucid.TUnsafe<string>;
1201
+ govNFT: _lucid_evolution_lucid.TObject<{
1202
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1203
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1204
+ }>;
1205
+ accountCreateFeeLovelaces: _lucid_evolution_lucid.TUnsafe<bigint>;
1206
+ accountAdjustmentFeeLovelaces: _lucid_evolution_lucid.TUnsafe<bigint>;
1207
+ requestCollateralLovelaces: _lucid_evolution_lucid.TUnsafe<bigint>;
1208
+ }>;
1209
+ type StabilityPoolParams = Data.Static<typeof StabilityPoolParamsSchema>;
1210
+ declare const StabilityPoolParams: StabilityPoolParams;
1211
+ declare function castStabilityPoolParams(params: StabilityPoolParams): Data;
1212
+ declare function mkSPInteger(value: bigint): SPInteger;
1213
+ declare function fromSPInteger(value: SPInteger): bigint;
1214
+ declare function spAdd(a: SPInteger, b: SPInteger): SPInteger;
1215
+ declare function spSub(a: SPInteger, b: SPInteger): SPInteger;
1216
+ declare function spMul(a: SPInteger, b: SPInteger): SPInteger;
1217
+ declare function spDiv(a: SPInteger, b: SPInteger): SPInteger;
1218
+
1219
+ declare const LRPParamsSchema: _lucid_evolution_lucid.TObject<{
1220
+ versionRecordToken: _lucid_evolution_lucid.TObject<{
1221
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1222
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1223
+ }>;
1224
+ iassetNft: _lucid_evolution_lucid.TObject<{
1225
+ currencySymbol: _lucid_evolution_lucid.TUnsafe<string>;
1226
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1227
+ }>;
1228
+ iassetPolicyId: _lucid_evolution_lucid.TUnsafe<string>;
1229
+ minRedemptionLovelacesAmt: _lucid_evolution_lucid.TUnsafe<bigint>;
1230
+ }>;
1231
+ type LRPParams = Data.Static<typeof LRPParamsSchema>;
1232
+ declare const LRPDatumSchema: _lucid_evolution_lucid.TObject<{
1233
+ owner: _lucid_evolution_lucid.TUnsafe<string>;
1234
+ iasset: _lucid_evolution_lucid.TUnsafe<string>;
1235
+ maxPrice: _lucid_evolution_lucid.TObject<{
1236
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
1237
+ }>;
1238
+ lovelacesToSpend: _lucid_evolution_lucid.TUnsafe<bigint>;
1239
+ }>;
1240
+ type LRPDatum = Data.Static<typeof LRPDatumSchema>;
1241
+ declare const LRPRedeemerSchema: _lucid_evolution_lucid.TUnion<(_lucid_evolution_lucid.TLiteral<"UpgradeVersion"> | _lucid_evolution_lucid.TObject<{
1242
+ Redeem: _lucid_evolution_lucid.TObject<{
1243
+ continuingOutputIdx: _lucid_evolution_lucid.TUnsafe<bigint>;
1244
+ }>;
1245
+ }> | _lucid_evolution_lucid.TObject<{
1246
+ RedeemAuxiliary: _lucid_evolution_lucid.TObject<{
1247
+ continuingOutputIdx: _lucid_evolution_lucid.TUnsafe<bigint>;
1248
+ mainRedeemOutRef: _lucid_evolution_lucid.TObject<{
1249
+ txHash: _lucid_evolution_lucid.TObject<{
1250
+ hash: _lucid_evolution_lucid.TUnsafe<string>;
1251
+ }>;
1252
+ outputIndex: _lucid_evolution_lucid.TUnsafe<bigint>;
1253
+ }>;
1254
+ asset: _lucid_evolution_lucid.TUnsafe<string>;
1255
+ assetPrice: _lucid_evolution_lucid.TObject<{
1256
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
1257
+ }>;
1258
+ redemptionReimbursementPercentage: _lucid_evolution_lucid.TObject<{
1259
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
1260
+ }>;
1261
+ }>;
1262
+ }> | _lucid_evolution_lucid.TLiteral<"Cancel">)[]>;
1263
+ type LRPRedeemer = Data.Static<typeof LRPRedeemerSchema>;
1264
+ declare function parseLrpDatum(datum: Datum): LRPDatum;
1265
+ declare function serialiseLrpDatum(datum: LRPDatum): Datum;
1266
+ declare function serialiseLrpRedeemer(redeemer: LRPRedeemer): Redeemer;
1267
+ declare function castLrpParams(params: LRPParams): Data;
1268
+
1269
+ declare const OnChainDecimalSchema: _lucid_evolution_lucid.TObject<{
1270
+ getOnChainInt: _lucid_evolution_lucid.TUnsafe<bigint>;
1271
+ }>;
1272
+ type OnChainDecimal = Data.Static<typeof OnChainDecimalSchema>;
1273
+
1274
+ declare function openLrp(assetTokenName: string, lovelacesAmt: bigint, maxPrice: OnChainDecimal, lucid: LucidEvolution, lrpScriptHash: ScriptHash, network: Network, lrpStakeCredential?: Credential$1): Promise<TxBuilder>;
1275
+ declare function cancelLrp(lrpOutRef: OutRef, lrpRefScriptOutRef: OutRef, lucid: LucidEvolution): Promise<TxBuilder>;
1276
+ declare function redeemLrp(redemptionLrpsData: [OutRef, bigint][], lrpRefScriptOutRef: OutRef, priceOracleOutRef: OutRef, iassetOutRef: OutRef, lucid: LucidEvolution, lrpParams: LRPParams, priceOracleParams: PriceOracleParams, network: Network): Promise<TxBuilder>;
1277
+
1278
+ declare const mkLrpValidator: (params: LRPParams) => SpendingValidator;
1279
+
1280
+ /**
1281
+ * Uses an always fail validator for the destination address.
1282
+ */
1283
+ declare function runCreateScriptRefTx(lucid: LucidEvolution, scriptRefValidator: SpendingValidator, network: Network): Promise<OutRef>;
1284
+
1285
+ declare const OneShotParamsSchema: _lucid_evolution_lucid.TObject<{
1286
+ referenceOutRef: _lucid_evolution_lucid.TObject<{
1287
+ txHash: _lucid_evolution_lucid.TUnsafe<string>;
1288
+ outputIdx: _lucid_evolution_lucid.TUnsafe<bigint>;
1289
+ }>;
1290
+ mintAmounts: _lucid_evolution_lucid.TArray<_lucid_evolution_lucid.TObject<{
1291
+ tokenName: _lucid_evolution_lucid.TUnsafe<string>;
1292
+ amount: _lucid_evolution_lucid.TUnsafe<bigint>;
1293
+ }>>;
1294
+ }>;
1295
+ type OneShotParams = Data.Static<typeof OneShotParamsSchema>;
1296
+
1297
+ declare function oneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<[TxBuilder, PolicyId]>;
1298
+ declare function runOneShotMintTx(lucid: LucidEvolution, params: OneShotParams): Promise<PolicyId>;
1299
+
1300
+ export { AccountAction, AccountActionSchema, AccountContent, AccountContentSchema, ActionReturnDatum, ActionReturnDatumSchema, Address, type AddressCredential, type AddressCredentialOrDatum, type AddressSP, AddressSchema, type Amount, type AssetClass, type AssetClassSP, AssetClassSchema, type AuthTokenPolicies, type CDPContent, CDPContentSchema, CDPContract, type CDPCreatorParamsSP, type CDPDatum, CDPDatumSchema, type CDPFees, CDPFeesSchema, type CdpParams, CollectorContract, type CollectorParams, Credential, CredentialSchema, type CurrencySymbol, type DistributionParams, EpochToScaleToSum, EpochToScaleToSumSchema, ExecuteParams, type ExecuteParamsSP, type FeedInterestOracleRedeemer, FeedInterestOracleRedeemerSchema, GovContract, type GovDatum, GovParams, type GovParamsSP, type IAssetContent, IAssetContentSchema, IAssetHelpers, type IAssetOutput, type Input, InterestOracleContract, type InterestOracleDatum, InterestOracleDatumSchema, type InterestOracleParams, InterestOracleParamsSchema, type LRPDatum, LRPDatumSchema, type LRPParams, LRPParamsSchema, type LRPRedeemer, LRPRedeemerSchema, ONE_SECOND, type OracleAssetNft, OracleAssetNftSchema, type Output, type OutputReference, OutputReferenceSchema, PollManagerParams, type PollManagerParamsSP, PollShardParams, type PollShardParamsSP, type PriceOracleDatum, PriceOracleDatumSchema, type PriceOracleParams, PriceOracleParamsSchema, type PubKeyHash, SPInteger, SPIntegerSchema, type ScriptCredential, type ScriptOutput, type ScriptRef, type ScriptReference, type ScriptReferences, SnapshotEpochToScaleToSumContent, SnapshotEpochToScaleToSumContentSchema, StabilityPoolContent, StabilityPoolContentSchema, StabilityPoolContract, StabilityPoolDatum, StabilityPoolDatumSchema, StabilityPoolParams, type StabilityPoolParamsSP, StabilityPoolRedeemer, StabilityPoolRedeemerSchema, StabilityPoolSnapshot, StakingContract, type StakingParams, type StartTime, type SystemParams, type TokenName, TreasuryContract, type TreasuryParams, type ValidatorHashes, VerificationKeyHashSchema, type VersionRecordParams, _cdpValidator, _collectorValidator, _treasuryValidator, addrDetails, addressFromBech32, addressToBech32, balance, calculateFeeFromPercentage, cancelLrp, castExecuteParams, castGovParams, castInterestOracleParams, castLrpParams, castPollManagerParams, castPollShardParams, castPriceOracleParams, castStabilityPoolParams, cdpCreatorValidator, createScriptAddress, fromSPInteger, fromSystemParamsAsset, getInlineDatumOrThrow, getRandomElement, loadSystemParamsFromFile, loadSystemParamsFromUrl, matchSingle, mkCDPCreatorValidator, mkCDPCreatorValidatorFromSP, mkInterestOracleValidator, mkLrpValidator, mkPollManagerValidator, mkPollManagerValidatorFromSP, mkPollShardValidator, mkPollShardValidatorFromSP, mkSPInteger, oneDay, oneHour, oneShotMintTx, oneYear, openLrp, parseAccountDatum, parseCDPDatum, parseGovDatum, parseIAssetDatum, parseInterestOracleDatum, parseLrpDatum, parsePriceOracleDatum, parseSnapshotEpochToScaleToSumDatum, parseStabilityPoolDatum, redeemLrp, runCreateScriptRefTx, runOneShotMintTx, scriptRef, serialiseCDPDatum, serialiseFeedInterestOracleRedeemer, serialiseGovDatum, serialiseIAssetDatum, serialiseInterestOracleDatum, serialiseLrpDatum, serialiseLrpRedeemer, serialisePriceOracleDatum, serialiseStabilityPoolDatum, serialiseStabilityPoolRedeemer, spAdd, spDiv, spMul, spSub, toSystemParamsAsset };