@indigo-labs/indigo-sdk 0.2.41 → 0.3.0
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/.github/workflows/ci.yml +4 -2
- package/dist/index.d.mts +3008 -2194
- package/dist/index.d.ts +3008 -2194
- package/dist/index.js +9827 -6194
- package/dist/index.mjs +8591 -4809
- package/package.json +14 -3
- package/src/contracts/cdp/helpers.ts +68 -72
- package/src/contracts/cdp/scripts.ts +50 -13
- package/src/contracts/cdp/transactions.ts +831 -545
- package/src/contracts/cdp/types-new.ts +256 -0
- package/src/contracts/cdp/types.ts +26 -144
- package/src/contracts/cdp-creator/scripts.ts +15 -9
- package/src/contracts/cdp-creator/types-new.ts +50 -0
- package/src/contracts/cdp-creator/types.ts +5 -31
- package/src/contracts/collector/scripts.ts +1 -1
- package/src/contracts/collector/transactions.ts +23 -13
- package/src/contracts/collector/types-new.ts +17 -0
- package/src/contracts/execute/scripts.ts +19 -10
- package/src/contracts/execute/types-new.ts +44 -0
- package/src/contracts/execute/types.ts +5 -38
- package/src/contracts/gov/helpers.ts +187 -51
- package/src/contracts/gov/scripts.ts +17 -10
- package/src/contracts/gov/transactions.ts +599 -271
- package/src/contracts/gov/types-new.ts +253 -100
- package/src/contracts/gov/types.ts +4 -71
- package/src/contracts/iasset/helpers.ts +172 -0
- package/src/contracts/iasset/scripts.ts +38 -0
- package/src/contracts/iasset/types.ts +154 -0
- package/src/contracts/initialize/actions.ts +768 -0
- package/src/contracts/initialize/helpers.ts +611 -36
- package/src/contracts/initialize/types.ts +102 -28
- package/src/contracts/interest-collection/helpers.ts +19 -0
- package/src/contracts/interest-collection/scripts.ts +44 -0
- package/src/contracts/interest-collection/transactions.ts +436 -0
- package/src/contracts/interest-collection/types-new.ts +50 -0
- package/src/contracts/interest-collection/types.ts +26 -0
- package/src/contracts/interest-oracle/helpers.ts +2 -30
- package/src/contracts/interest-oracle/scripts.ts +1 -1
- package/src/contracts/interest-oracle/transactions.ts +21 -16
- package/src/contracts/interest-oracle/types-new.ts +32 -0
- package/src/contracts/interest-oracle/types.ts +1 -40
- package/src/contracts/one-shot/transactions.ts +1 -2
- package/src/contracts/poll/helpers.ts +5 -23
- package/src/contracts/poll/scripts.ts +12 -13
- package/src/contracts/poll/types-poll-manager.ts +1 -19
- package/src/contracts/poll/types-poll-new.ts +170 -0
- package/src/contracts/poll/types-poll-shard.ts +2 -24
- package/src/contracts/price-oracle/helpers.ts +1 -4
- package/src/contracts/price-oracle/scripts.ts +3 -8
- package/src/contracts/price-oracle/transactions.ts +32 -25
- package/src/contracts/price-oracle/types-new.ts +50 -0
- package/src/contracts/price-oracle/types.ts +2 -36
- package/src/contracts/pyth-feed/helpers.ts +58 -0
- package/src/contracts/pyth-feed/scripts.ts +15 -0
- package/src/contracts/pyth-feed/types.ts +181 -0
- package/src/contracts/rob/helpers.ts +405 -0
- package/src/contracts/rob/scripts.ts +35 -0
- package/src/contracts/rob/transactions.ts +410 -0
- package/src/contracts/rob/types-new.ts +128 -0
- package/src/contracts/rob/types.ts +16 -0
- package/src/contracts/rob-leverage/helpers.ts +424 -0
- package/src/contracts/{leverage → rob-leverage}/transactions.ts +68 -48
- package/src/contracts/stability-pool/helpers.ts +714 -230
- package/src/contracts/stability-pool/scripts.ts +20 -15
- package/src/contracts/stability-pool/transactions.ts +625 -495
- package/src/contracts/stability-pool/types-new.ts +237 -100
- package/src/contracts/stability-pool/types.ts +5 -22
- package/src/contracts/stableswap/helpers.ts +22 -0
- package/src/contracts/stableswap/scripts.ts +37 -0
- package/src/contracts/stableswap/transactions.ts +647 -0
- package/src/contracts/stableswap/types-new.ts +131 -0
- package/src/contracts/stableswap/types.ts +17 -0
- package/src/contracts/staking/helpers.ts +49 -34
- package/src/contracts/staking/scripts.ts +1 -1
- package/src/contracts/staking/transactions.ts +85 -130
- package/src/contracts/staking/types-new.ts +60 -28
- package/src/contracts/staking/types.ts +1 -28
- package/src/contracts/treasury/helpers.ts +21 -0
- package/src/contracts/treasury/scripts.ts +16 -26
- package/src/contracts/treasury/transactions.ts +256 -27
- package/src/contracts/treasury/types-new.ts +69 -0
- package/src/contracts/treasury/types.ts +2 -43
- package/src/contracts/version-registry/scripts.ts +2 -2
- package/src/contracts/version-registry/types-new.ts +6 -7
- package/src/index.ts +37 -20
- package/src/scripts/auth-token-policy.ts +3 -2
- package/src/scripts/iasset-policy.ts +3 -2
- package/src/types/evolution-schema-options.ts +3 -3
- package/src/types/generic.ts +17 -89
- package/src/types/multisig.ts +48 -0
- package/src/types/on-chain-decimal.ts +14 -7
- package/src/types/rational.ts +61 -0
- package/src/types/system-params.ts +237 -41
- package/src/utils/array-utils.ts +70 -1
- package/src/utils/bigint-utils.ts +12 -0
- package/src/utils/indigo-helpers.ts +8 -10
- package/src/utils/lucid-utils.ts +47 -40
- package/src/utils/oracle-helpers.ts +62 -0
- package/src/utils/pyth/decode.ts +223 -0
- package/src/utils/pyth/encode.ts +262 -0
- package/src/utils/pyth/index.ts +14 -0
- package/src/utils/pyth/types.ts +87 -0
- package/src/validators/always-succeed-validator.ts +6 -0
- package/src/validators/cdp-creator-validator.ts +2 -2
- package/src/validators/cdp-redeem-validator.ts +7 -0
- package/src/validators/cdp-validator.ts +2 -2
- package/src/validators/collector-validator.ts +2 -2
- package/src/validators/execute-validator.ts +2 -2
- package/src/validators/governance-validator.ts +2 -2
- package/src/validators/iasset-validator.ts +7 -0
- package/src/validators/interest-collection-validator.ts +7 -0
- package/src/validators/interest-oracle-validator.ts +2 -2
- package/src/validators/poll-manager-validator.ts +2 -2
- package/src/validators/poll-shard-validator.ts +2 -2
- package/src/validators/price-oracle-validator.ts +7 -0
- package/src/validators/pyth-feed-validator.ts +7 -0
- package/src/validators/rob-validator.ts +7 -0
- package/src/validators/stability-pool-validator.ts +2 -2
- package/src/validators/stableswap-validator.ts +7 -0
- package/src/validators/staking-validator.ts +2 -2
- package/src/validators/treasury-validator.ts +2 -2
- package/src/validators/version-record-policy.ts +2 -2
- package/src/validators/version-registry-validator.ts +2 -2
- package/tests/always-succeed/script.ts +7 -0
- package/tests/bigint-utils.test.ts +41 -0
- package/tests/cdp/actions.ts +611 -0
- package/tests/cdp/cdp-helpers.ts +55 -0
- package/tests/cdp/cdp-queries.ts +440 -0
- package/tests/cdp/cdp.test.ts +6087 -0
- package/tests/cdp/transactions-mutated.ts +1729 -0
- package/tests/data/system-params.json +177 -34
- package/tests/datums.test.ts +209 -210
- package/tests/endpoints/initialize.ts +68 -0
- package/tests/endpoints/interest-collector.ts +37 -0
- package/tests/endpoints/treasury.ts +70 -0
- package/tests/gov/actions.ts +406 -0
- package/tests/gov/gov.test.ts +4450 -0
- package/tests/{queries → gov}/governance-queries.ts +6 -3
- package/tests/hash-checks.test.ts +38 -11
- package/tests/indigo-test-helpers.ts +100 -0
- package/tests/initialize.test.ts +61 -9
- package/tests/interest-collection/interest-collection.test.ts +892 -0
- package/tests/interest-collection/interest-collector-queries.ts +49 -0
- package/tests/interest-collection/transactions-mutated.ts +260 -0
- package/tests/interest-oracle.test.ts +43 -35
- package/tests/mock/assets-mock.ts +234 -23
- package/tests/mock/protocol-params-mock.ts +21 -0
- package/tests/price-oracle/actions.ts +163 -0
- package/tests/price-oracle/price-oracle-queries.ts +12 -0
- package/tests/price-oracle/price-oracle.test.ts +240 -0
- package/tests/price-oracle/transactions-mutated.ts +62 -0
- package/tests/pyth/endpoints.ts +96 -0
- package/tests/pyth/helpers.ts +37 -0
- package/tests/pyth/pyth-encoding.test.ts +376 -0
- package/tests/pyth/pyth-indigo.test.ts +509 -0
- package/tests/pyth/pyth.test.ts +300 -0
- package/tests/queries/execute-queries.ts +6 -5
- package/tests/queries/iasset-queries.ts +175 -5
- package/tests/queries/interest-oracle-queries.ts +4 -2
- package/tests/queries/poll-queries.ts +8 -9
- package/tests/queries/stability-pool-queries.ts +95 -48
- package/tests/queries/staking-queries.ts +4 -2
- package/tests/queries/treasury-queries.ts +80 -5
- package/tests/rob/actions.ts +58 -0
- package/tests/{lrp-leverage.test.ts → rob/rob-leverage.test.ts} +393 -296
- package/tests/rob/rob-queries.ts +95 -0
- package/tests/rob/rob.test.ts +3762 -0
- package/tests/rob/transactions-mutated.ts +853 -0
- package/tests/script-size.test.ts +240 -0
- package/tests/setup.ts +135 -0
- package/tests/stability-pool/actions.ts +210 -0
- package/tests/stability-pool.test.ts +5469 -666
- package/tests/stableswap/stableswap-actions.ts +84 -0
- package/tests/stableswap/stableswap-queries.ts +89 -0
- package/tests/stableswap/stableswap.test.ts +3891 -0
- package/tests/stableswap/transactions-mutated.ts +348 -0
- package/tests/staking.test.ts +82 -99
- package/tests/test-helpers.ts +58 -11
- package/tests/treasury.test.ts +242 -0
- package/tests/utils/asserts.ts +74 -0
- package/tests/utils/benchmark-utils.ts +81 -0
- package/tests/utils/index.ts +122 -4
- package/tsconfig.json +9 -1
- package/vitest.config.ts +3 -1
- package/src/contracts/collector/types.ts +0 -16
- package/src/contracts/initialize/transactions.ts +0 -891
- package/src/contracts/leverage/helpers.ts +0 -424
- package/src/contracts/lrp/helpers.ts +0 -294
- package/src/contracts/lrp/scripts.ts +0 -27
- package/src/contracts/lrp/transactions.ts +0 -250
- package/src/contracts/lrp/types.ts +0 -131
- package/src/contracts/poll/types-poll.ts +0 -88
- package/src/contracts/vesting/helpers.ts +0 -218
- package/src/utils/value-helpers.ts +0 -37
- package/src/validators/lrp-validator.ts +0 -7
- package/tests/cdp.test.ts +0 -1528
- package/tests/gov.test.ts +0 -2011
- package/tests/lrp.test.ts +0 -673
- package/tests/queries/cdp-queries.ts +0 -220
- package/tests/queries/lrp-queries.ts +0 -76
- package/tests/queries/price-oracle-queries.ts +0 -10
|
@@ -1,115 +1,268 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Data } from '@lucid-evolution/lucid';
|
|
3
|
-
import { OracleAssetNftSchema } from '../price-oracle/types';
|
|
4
|
-
import { AssetClassSchema } from '../../types/generic';
|
|
5
|
-
import { OnChainDecimalSchema } from '../../types/on-chain-decimal';
|
|
6
|
-
import { IAssetPriceInfoSchema } from '../cdp/types';
|
|
1
|
+
import { TSchema, Data } from '@evolution-sdk/evolution';
|
|
7
2
|
import { DEFAULT_SCHEMA_OPTIONS } from '../../types/evolution-schema-options';
|
|
3
|
+
import {
|
|
4
|
+
AddressSchema,
|
|
5
|
+
AssetClassSchema,
|
|
6
|
+
} from '@3rd-eye-labs/cardano-offchain-common';
|
|
7
|
+
import { option as O, function as F } from 'fp-ts';
|
|
8
|
+
import { IAssetPriceInfoSchema } from '../iasset/types';
|
|
9
|
+
import { MultisigSchema } from '../../types/multisig';
|
|
10
|
+
import { RationalSchema } from '../../types/rational';
|
|
8
11
|
|
|
9
|
-
export const ProtocolParamsSchema =
|
|
10
|
-
proposalDeposit:
|
|
11
|
-
votingPeriod:
|
|
12
|
-
effectiveDelay:
|
|
13
|
-
expirationPeriod:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/// Maximum amount of INDY that can be spent at once from the treasury.
|
|
23
|
-
maxTreasuryIndySpend: Data.Integer(),
|
|
12
|
+
export const ProtocolParamsSchema = TSchema.Struct({
|
|
13
|
+
proposalDeposit: TSchema.Integer,
|
|
14
|
+
votingPeriod: TSchema.Integer,
|
|
15
|
+
effectiveDelay: TSchema.Integer,
|
|
16
|
+
expirationPeriod: TSchema.Integer,
|
|
17
|
+
proposingPeriod: TSchema.Integer,
|
|
18
|
+
totalShards: TSchema.Integer,
|
|
19
|
+
minimumQuorum: TSchema.Integer,
|
|
20
|
+
maxTreasuryLovelaceSpend: TSchema.Integer,
|
|
21
|
+
maxTreasuryIndySpend: TSchema.Integer,
|
|
22
|
+
cdpRedemptionRequiredSignature: TSchema.NullOr(TSchema.ByteArray),
|
|
23
|
+
electorate: TSchema.Integer,
|
|
24
|
+
foundationMultisig: MultisigSchema,
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
export type ProtocolParams =
|
|
27
|
-
export const ProtocolParams = ProtocolParamsSchema as unknown as ProtocolParams;
|
|
27
|
+
export type ProtocolParams = typeof ProtocolParamsSchema.Type;
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
priceOracleNft: OracleAssetNftSchema,
|
|
32
|
-
interestOracleNft: AssetClassSchema,
|
|
33
|
-
redemptionRatioPercentage: OnChainDecimalSchema,
|
|
34
|
-
maintenanceRatioPercentage: OnChainDecimalSchema,
|
|
35
|
-
liquidationRatioPercentage: OnChainDecimalSchema,
|
|
36
|
-
debtMintingFeePercentage: OnChainDecimalSchema,
|
|
37
|
-
liquidationProcessingFeePercentage: OnChainDecimalSchema,
|
|
38
|
-
stabilityPoolWithdrawalFeePercentage: OnChainDecimalSchema,
|
|
39
|
-
redemptionReimbursementPercentage: OnChainDecimalSchema,
|
|
40
|
-
redemptionProcessingFeePercentage: OnChainDecimalSchema,
|
|
41
|
-
interestCollectorPortionPercentage: OnChainDecimalSchema,
|
|
42
|
-
});
|
|
43
|
-
export type ProposeAssetContent = Data.Static<typeof ProposeAssetContentSchema>;
|
|
44
|
-
|
|
45
|
-
export const ProposalContentSchema = Data.Enum([
|
|
46
|
-
Data.Object({
|
|
47
|
-
ProposeAsset: ProposeAssetContentSchema,
|
|
48
|
-
}),
|
|
49
|
-
Data.Object({
|
|
50
|
-
ModifyAsset: Data.Object({
|
|
51
|
-
asset: Data.Bytes(),
|
|
52
|
-
newAssetPriceInfo: IAssetPriceInfoSchema,
|
|
53
|
-
newInterestOracleNft: AssetClassSchema,
|
|
54
|
-
newRedemptionRatioPercentage: OnChainDecimalSchema,
|
|
55
|
-
newMaintenanceRatioPercentage: OnChainDecimalSchema,
|
|
56
|
-
newLiquidationRatioPercentage: OnChainDecimalSchema,
|
|
57
|
-
newDebtMintingFeePercentage: OnChainDecimalSchema,
|
|
58
|
-
newLiquidationProcessingFeePercentage: OnChainDecimalSchema,
|
|
59
|
-
newStabilityPoolWithdrawalFeePercentage: OnChainDecimalSchema,
|
|
60
|
-
newRedemptionReimbursementPercentage: OnChainDecimalSchema,
|
|
61
|
-
newRedemptionProcessingFeePercentage: OnChainDecimalSchema,
|
|
62
|
-
newInterestCollectorPortionPercentage: OnChainDecimalSchema,
|
|
63
|
-
}),
|
|
64
|
-
}),
|
|
65
|
-
Data.Object({
|
|
66
|
-
ModifyProtocolParams: Data.Object({
|
|
67
|
-
newParams: ProtocolParamsSchema,
|
|
68
|
-
}),
|
|
69
|
-
}),
|
|
70
|
-
Data.Object({
|
|
71
|
-
UpgradeProtocol: Data.Object({
|
|
72
|
-
content:
|
|
73
|
-
// NOTICE: This is replaced by evolution-sdk encoding of `UpgradePathsSchema` defined in this file.
|
|
74
|
-
Data.Any(),
|
|
75
|
-
}),
|
|
76
|
-
}),
|
|
77
|
-
Data.Object({
|
|
78
|
-
TextProposal: Data.Object({
|
|
79
|
-
bytes: Data.Bytes(),
|
|
80
|
-
}),
|
|
81
|
-
}),
|
|
82
|
-
]);
|
|
83
|
-
export type ProposalContent = Data.Static<typeof ProposalContentSchema>;
|
|
84
|
-
export const ProposalContent =
|
|
85
|
-
ProposalContentSchema as unknown as ProposalContent;
|
|
86
|
-
|
|
87
|
-
const UpgradePathSchema = EvoCore.TSchema.Struct({
|
|
88
|
-
upgradeSymbol: EvoCore.TSchema.ByteArray,
|
|
29
|
+
const UpgradePathSchema = TSchema.Struct({
|
|
30
|
+
upgradeSymbol: TSchema.ByteArray,
|
|
89
31
|
});
|
|
90
32
|
|
|
91
|
-
const UpgradePathsSchema =
|
|
92
|
-
upgradeId:
|
|
33
|
+
const UpgradePathsSchema = TSchema.Struct({
|
|
34
|
+
upgradeId: TSchema.Integer,
|
|
93
35
|
/// Underlying representation of the following mapping: ValidatorHash -> UpgradePath
|
|
94
|
-
upgradePaths:
|
|
95
|
-
|
|
96
|
-
UpgradePathSchema,
|
|
36
|
+
upgradePaths: TSchema.Array(
|
|
37
|
+
TSchema.Tuple([TSchema.ByteArray, UpgradePathSchema]),
|
|
97
38
|
),
|
|
98
39
|
});
|
|
99
40
|
export type UpgradePaths = typeof UpgradePathsSchema.Type;
|
|
100
41
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
42
|
+
const ProposeIAssetContentSchema = TSchema.Struct({
|
|
43
|
+
asset: TSchema.ByteArray,
|
|
44
|
+
debtMintingFeeRatio: RationalSchema,
|
|
45
|
+
liquidationProcessingFeeRatio: RationalSchema,
|
|
46
|
+
stabilityPoolWithdrawalFeeRatio: RationalSchema,
|
|
47
|
+
redemptionReimbursementRatio: RationalSchema,
|
|
48
|
+
redemptionProcessingFeeRatio: RationalSchema,
|
|
49
|
+
});
|
|
50
|
+
export type ProposeAssetContent = typeof ProposeIAssetContentSchema.Type;
|
|
51
|
+
|
|
52
|
+
const ModifyIAssetContentSchema = TSchema.Struct({
|
|
53
|
+
asset: TSchema.ByteArray,
|
|
54
|
+
newDebtMintingFeeRatio: RationalSchema,
|
|
55
|
+
newLiquidationProcessingFeeRatio: RationalSchema,
|
|
56
|
+
newStabilityPoolWithdrawalFeeRatio: RationalSchema,
|
|
57
|
+
newRedemptionReimbursementRatio: RationalSchema,
|
|
58
|
+
newRedemptionProcessingFeeRatio: RationalSchema,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const AddCollateralAssetContentSchema = TSchema.Struct({
|
|
62
|
+
correspondingIAsset: TSchema.ByteArray,
|
|
63
|
+
collateralAsset: AssetClassSchema,
|
|
64
|
+
assetExtraDecimals: TSchema.Integer,
|
|
65
|
+
assetPriceInfo: IAssetPriceInfoSchema,
|
|
66
|
+
interestOracleNft: AssetClassSchema,
|
|
67
|
+
redemptionRatio: RationalSchema,
|
|
68
|
+
maintenanceRatio: RationalSchema,
|
|
69
|
+
liquidationRatio: RationalSchema,
|
|
70
|
+
minCollateralAmt: TSchema.Integer,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export type AddCollateralAsssetContent =
|
|
74
|
+
typeof AddCollateralAssetContentSchema.Type;
|
|
75
|
+
|
|
76
|
+
const UpdateCollateralAssetContentSchema = TSchema.Struct({
|
|
77
|
+
correspondingIAsset: TSchema.ByteArray,
|
|
78
|
+
collateralAsset: AssetClassSchema,
|
|
79
|
+
newAssetExtraDecimals: TSchema.Integer,
|
|
80
|
+
newAssetPriceInfo: IAssetPriceInfoSchema,
|
|
81
|
+
newInterestOracleNft: AssetClassSchema,
|
|
82
|
+
newRedemptionRatio: RationalSchema,
|
|
83
|
+
newMaintenanceRatio: RationalSchema,
|
|
84
|
+
newLiquidationRatio: RationalSchema,
|
|
85
|
+
newMinCollateralAmt: TSchema.Integer,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const ProposeStableswapPoolContentSchema = TSchema.Struct({
|
|
89
|
+
iasset: TSchema.ByteArray,
|
|
90
|
+
collateralAsset: AssetClassSchema,
|
|
91
|
+
collateralToIassetRatio: RationalSchema,
|
|
92
|
+
mintingFeeRatio: RationalSchema,
|
|
93
|
+
redemptionFeeRatio: RationalSchema,
|
|
94
|
+
feeManager: TSchema.NullOr(TSchema.ByteArray),
|
|
95
|
+
minMintingAmount: TSchema.Integer,
|
|
96
|
+
minRedemptionAmount: TSchema.Integer,
|
|
97
|
+
stableswapValHash: TSchema.ByteArray,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export type ProposeStableswapPoolContent =
|
|
101
|
+
typeof ProposeStableswapPoolContentSchema.Type;
|
|
102
|
+
|
|
103
|
+
const ModifyStableswapPoolContentSchema = TSchema.Struct({
|
|
104
|
+
iasset: TSchema.ByteArray,
|
|
105
|
+
collateralAsset: AssetClassSchema,
|
|
106
|
+
newCollateralToIassetRatio: RationalSchema,
|
|
107
|
+
newMintingFeeRatio: RationalSchema,
|
|
108
|
+
newRedemptionFeeRatio: RationalSchema,
|
|
109
|
+
newMintingEnabled: TSchema.Boolean,
|
|
110
|
+
newRedemptionEnabled: TSchema.Boolean,
|
|
111
|
+
newFeeManager: TSchema.NullOr(TSchema.ByteArray),
|
|
112
|
+
newMinMintingAmount: TSchema.Integer,
|
|
113
|
+
newMinRedemptionAmount: TSchema.Integer,
|
|
114
|
+
newStableswapValHash: TSchema.ByteArray,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export type ModifyStableswapPoolContent =
|
|
118
|
+
typeof ModifyStableswapPoolContentSchema.Type;
|
|
119
|
+
|
|
120
|
+
export const ProposalContentSchema = TSchema.Union(
|
|
121
|
+
TSchema.Struct(
|
|
122
|
+
{
|
|
123
|
+
ProposeIAsset: ProposeIAssetContentSchema,
|
|
124
|
+
},
|
|
125
|
+
{ flatInUnion: true },
|
|
126
|
+
),
|
|
127
|
+
TSchema.Struct(
|
|
128
|
+
{
|
|
129
|
+
ModifyIAsset: ModifyIAssetContentSchema,
|
|
130
|
+
},
|
|
131
|
+
{ flatInUnion: true },
|
|
132
|
+
),
|
|
133
|
+
TSchema.Struct(
|
|
134
|
+
{
|
|
135
|
+
AddCollateralAsset: AddCollateralAssetContentSchema,
|
|
136
|
+
},
|
|
137
|
+
{ flatInUnion: true },
|
|
138
|
+
),
|
|
139
|
+
TSchema.Struct(
|
|
140
|
+
{
|
|
141
|
+
UpdateCollateralAsset: UpdateCollateralAssetContentSchema,
|
|
142
|
+
},
|
|
143
|
+
{ flatInUnion: true },
|
|
144
|
+
),
|
|
145
|
+
TSchema.Struct(
|
|
146
|
+
{
|
|
147
|
+
ProposeStableswapPool: ProposeStableswapPoolContentSchema,
|
|
148
|
+
},
|
|
149
|
+
{ flatInUnion: true },
|
|
150
|
+
),
|
|
151
|
+
TSchema.Struct(
|
|
152
|
+
{
|
|
153
|
+
ModifyStableswapPool: ModifyStableswapPoolContentSchema,
|
|
154
|
+
},
|
|
155
|
+
{ flatInUnion: true },
|
|
156
|
+
),
|
|
157
|
+
TSchema.Struct(
|
|
158
|
+
{
|
|
159
|
+
ModifyProtocolParams: TSchema.Struct(
|
|
160
|
+
{
|
|
161
|
+
newParams: ProtocolParamsSchema,
|
|
162
|
+
},
|
|
163
|
+
{ flatFields: true },
|
|
164
|
+
),
|
|
165
|
+
},
|
|
166
|
+
{ flatInUnion: true },
|
|
167
|
+
),
|
|
168
|
+
TSchema.Struct(
|
|
169
|
+
{
|
|
170
|
+
UpgradeProtocol: TSchema.Struct(
|
|
171
|
+
{
|
|
172
|
+
content: UpgradePathsSchema,
|
|
173
|
+
},
|
|
174
|
+
{ flatFields: true },
|
|
175
|
+
),
|
|
176
|
+
},
|
|
177
|
+
{ flatInUnion: true },
|
|
178
|
+
),
|
|
179
|
+
TSchema.Struct(
|
|
180
|
+
{
|
|
181
|
+
TextProposal: TSchema.ByteArray,
|
|
182
|
+
},
|
|
183
|
+
{ flatInUnion: true },
|
|
184
|
+
),
|
|
185
|
+
);
|
|
186
|
+
export type ProposalContent = typeof ProposalContentSchema.Type;
|
|
187
|
+
|
|
188
|
+
const TreasuryWithdrawalItemSchema = TSchema.Struct({
|
|
189
|
+
currencySymbol: TSchema.ByteArray,
|
|
190
|
+
tokenName: TSchema.ByteArray,
|
|
191
|
+
amount: TSchema.Integer,
|
|
192
|
+
});
|
|
193
|
+
export type TreasuryWithdrawalItem = typeof TreasuryWithdrawalItemSchema.Type;
|
|
194
|
+
|
|
195
|
+
export const TreasuryWithdrawalSchema = TSchema.Struct({
|
|
196
|
+
destination: AddressSchema,
|
|
197
|
+
value: TSchema.Array(TreasuryWithdrawalItemSchema),
|
|
198
|
+
});
|
|
199
|
+
export type TreasuryWithdrawal = typeof TreasuryWithdrawalSchema.Type;
|
|
200
|
+
|
|
201
|
+
const GovRedeemerSchema = TSchema.Union(
|
|
202
|
+
TSchema.Struct(
|
|
203
|
+
{
|
|
204
|
+
CreatePoll: TSchema.Struct(
|
|
205
|
+
{
|
|
206
|
+
currentTime: TSchema.Integer,
|
|
207
|
+
proposalOwner: TSchema.ByteArray,
|
|
208
|
+
content: ProposalContentSchema,
|
|
209
|
+
treasuryWithdrawal: TSchema.NullOr(TreasuryWithdrawalSchema),
|
|
210
|
+
},
|
|
211
|
+
{ flatFields: true },
|
|
212
|
+
),
|
|
213
|
+
},
|
|
214
|
+
{ flatInUnion: true },
|
|
215
|
+
),
|
|
216
|
+
TSchema.Struct(
|
|
217
|
+
{
|
|
218
|
+
WitnessEndPoll: TSchema.Struct(
|
|
219
|
+
{
|
|
220
|
+
currentTime: TSchema.Integer,
|
|
221
|
+
},
|
|
222
|
+
{ flatFields: true },
|
|
223
|
+
),
|
|
224
|
+
},
|
|
225
|
+
{ flatInUnion: true },
|
|
226
|
+
),
|
|
227
|
+
TSchema.Literal('UpgradeGov', { flatInUnion: true }),
|
|
228
|
+
TSchema.Literal('UpgradeVersion', { flatInUnion: true }),
|
|
229
|
+
);
|
|
230
|
+
export type GovRedeemer = typeof GovRedeemerSchema.Type;
|
|
231
|
+
|
|
232
|
+
const GovDatumSchema = TSchema.Struct({
|
|
233
|
+
currentProposal: TSchema.Integer,
|
|
234
|
+
protocolParams: ProtocolParamsSchema,
|
|
235
|
+
currentVersion: TSchema.Integer,
|
|
236
|
+
iassetsCount: TSchema.Integer,
|
|
237
|
+
activeProposals: TSchema.Integer,
|
|
238
|
+
});
|
|
239
|
+
export type GovDatum = typeof GovDatumSchema.Type;
|
|
240
|
+
|
|
241
|
+
export function serialiseGovRedeemer(r: GovRedeemer): string {
|
|
242
|
+
return Data.withSchema(GovRedeemerSchema).toCBORHex(r);
|
|
108
243
|
}
|
|
109
244
|
|
|
110
|
-
export function
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
245
|
+
export function serialiseGovDatum(d: GovDatum): string {
|
|
246
|
+
return Data.withSchema(GovDatumSchema).toCBORHex(d);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export function parseGovDatum(datum: string): O.Option<GovDatum> {
|
|
250
|
+
try {
|
|
251
|
+
return O.some(
|
|
252
|
+
Data.withSchema(GovDatumSchema, DEFAULT_SCHEMA_OPTIONS).fromCBORHex(
|
|
253
|
+
datum,
|
|
254
|
+
),
|
|
255
|
+
);
|
|
256
|
+
} catch (_) {
|
|
257
|
+
return O.none;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function parseGovDatumOrThrow(datum: string): GovDatum {
|
|
262
|
+
return F.pipe(
|
|
263
|
+
parseGovDatum(datum),
|
|
264
|
+
O.match(() => {
|
|
265
|
+
throw new Error('Expected a Gov datum.');
|
|
266
|
+
}, F.identity),
|
|
267
|
+
);
|
|
115
268
|
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import { Data
|
|
2
|
-
import {
|
|
3
|
-
import { option as O, function as F } from 'fp-ts';
|
|
4
|
-
import { ProposalContentSchema, ProtocolParamsSchema } from './types-new';
|
|
5
|
-
|
|
6
|
-
const GovDatumSchema = Data.Object({
|
|
7
|
-
currentProposal: Data.Integer(),
|
|
8
|
-
protocolParams: ProtocolParamsSchema,
|
|
9
|
-
currentVersion: Data.Integer(),
|
|
10
|
-
iassetsCount: Data.Integer(),
|
|
11
|
-
activeProposals: Data.Integer(),
|
|
12
|
-
treasuryIndyWithdrawnAmt: Data.Integer(),
|
|
13
|
-
});
|
|
14
|
-
export type GovDatum = Data.Static<typeof GovDatumSchema>;
|
|
15
|
-
const GovDatum = GovDatumSchema as unknown as GovDatum;
|
|
1
|
+
import { Data } from '@lucid-evolution/lucid';
|
|
2
|
+
import { AssetClassSchema } from '../../types/generic';
|
|
16
3
|
|
|
17
4
|
const GovParamsSchema = Data.Object({
|
|
18
5
|
govNFT: AssetClassSchema,
|
|
@@ -20,7 +7,9 @@ const GovParamsSchema = Data.Object({
|
|
|
20
7
|
upgradeToken: AssetClassSchema,
|
|
21
8
|
indyAsset: AssetClassSchema,
|
|
22
9
|
versionRecordToken: AssetClassSchema,
|
|
10
|
+
iassetSymbol: Data.Bytes(),
|
|
23
11
|
pollManagerValHash: Data.Bytes(),
|
|
12
|
+
iassetValHash: Data.Bytes(),
|
|
24
13
|
gBiasTime: Data.Integer(),
|
|
25
14
|
daoIdentityToken: AssetClassSchema,
|
|
26
15
|
iAssetAuthToken: AssetClassSchema,
|
|
@@ -28,62 +17,6 @@ const GovParamsSchema = Data.Object({
|
|
|
28
17
|
export type GovParams = Data.Static<typeof GovParamsSchema>;
|
|
29
18
|
export const GovParams = GovParamsSchema as unknown as GovParams;
|
|
30
19
|
|
|
31
|
-
const ValueWithdrawalItemSchema = Data.Tuple(
|
|
32
|
-
[Data.Bytes(), Data.Bytes(), Data.Integer()],
|
|
33
|
-
{ hasConstr: true },
|
|
34
|
-
);
|
|
35
|
-
export type TreasuryWithdrawalItem = Data.Static<
|
|
36
|
-
typeof ValueWithdrawalItemSchema
|
|
37
|
-
>;
|
|
38
|
-
|
|
39
|
-
export const TreasuryWithdrawalSchema = Data.Object({
|
|
40
|
-
destination: AddressSchema,
|
|
41
|
-
value: Data.Array(ValueWithdrawalItemSchema),
|
|
42
|
-
});
|
|
43
|
-
export type TreasuryWithdrawal = Data.Static<typeof TreasuryWithdrawalSchema>;
|
|
44
|
-
|
|
45
|
-
const GovRedeemerSchema = Data.Enum([
|
|
46
|
-
Data.Object({
|
|
47
|
-
CreatePoll: Data.Object({
|
|
48
|
-
currentTime: Data.Integer(),
|
|
49
|
-
proposalOwner: Data.Bytes(),
|
|
50
|
-
content: ProposalContentSchema,
|
|
51
|
-
treasuryWithdrawal: Data.Nullable(TreasuryWithdrawalSchema),
|
|
52
|
-
}),
|
|
53
|
-
}),
|
|
54
|
-
Data.Object({ WitnessEndPoll: Data.Object({ currentTime: Data.Integer() }) }),
|
|
55
|
-
Data.Literal('UpgradeGov'),
|
|
56
|
-
Data.Literal('UpgradeVersion'),
|
|
57
|
-
]);
|
|
58
|
-
|
|
59
|
-
export type GovRedeemer = Data.Static<typeof GovRedeemerSchema>;
|
|
60
|
-
export const GovRedeemer = GovRedeemerSchema as unknown as GovRedeemer;
|
|
61
|
-
|
|
62
|
-
export function parseGovDatum(datum: Datum): O.Option<GovDatum> {
|
|
63
|
-
try {
|
|
64
|
-
return O.some(Data.from<GovDatum>(datum, GovDatum));
|
|
65
|
-
} catch (_) {
|
|
66
|
-
return O.none;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function parseGovDatumOrThrow(datum: Datum): GovDatum {
|
|
71
|
-
return F.pipe(
|
|
72
|
-
parseGovDatum(datum),
|
|
73
|
-
O.match(() => {
|
|
74
|
-
throw new Error('Expected a Gov datum.');
|
|
75
|
-
}, F.identity),
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function serialiseGovDatum(d: GovDatum): Datum {
|
|
80
|
-
return Data.to<GovDatum>(d, GovDatum);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function serialiseGovRedeemer(redeemer: GovRedeemer): Redeemer {
|
|
84
|
-
return Data.to<GovRedeemer>(redeemer, GovRedeemer);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
20
|
export function castGovParams(params: GovParams): Data {
|
|
88
21
|
return Data.castTo(params, GovParams);
|
|
89
22
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
credentialToRewardAddress,
|
|
3
|
+
Data,
|
|
4
|
+
fromHex,
|
|
5
|
+
LucidEvolution,
|
|
6
|
+
OutRef,
|
|
7
|
+
scriptHashToCredential,
|
|
8
|
+
slotToUnixTime,
|
|
9
|
+
toHex,
|
|
10
|
+
TxBuilder,
|
|
11
|
+
UTxO,
|
|
12
|
+
} from '@lucid-evolution/lucid';
|
|
13
|
+
import { IAssetPriceInfo } from './types';
|
|
14
|
+
import { matchSingle } from '../../utils/utils';
|
|
15
|
+
import { parsePriceOracleDatum } from '../price-oracle/types-new';
|
|
16
|
+
import { getInlineDatumOrThrow } from '../../utils/lucid-utils';
|
|
17
|
+
import { oracleExpirationAwareValidity } from '../price-oracle/helpers';
|
|
18
|
+
import {
|
|
19
|
+
fromSysParamsDerivedPythPrice,
|
|
20
|
+
fromSystemParamsScriptRef,
|
|
21
|
+
getPythFeedConfig,
|
|
22
|
+
PythConfig,
|
|
23
|
+
} from '../../types/system-params';
|
|
24
|
+
import {
|
|
25
|
+
parsePythStateDatum,
|
|
26
|
+
serialisePythFeedRedeemer,
|
|
27
|
+
serialisePythUpdatesRedeemer,
|
|
28
|
+
} from '../pyth-feed/types';
|
|
29
|
+
import { match, P } from 'ts-pattern';
|
|
30
|
+
import { derivePythPrice } from '../pyth-feed/helpers';
|
|
31
|
+
import { AssetClass } from '@3rd-eye-labs/cardano-offchain-common';
|
|
32
|
+
import * as Core from '@evolution-sdk/evolution';
|
|
33
|
+
import { decodePriceUpdate, decodePythMessage } from '../../utils/pyth';
|
|
34
|
+
|
|
35
|
+
type Interval = {
|
|
36
|
+
validFrom: number;
|
|
37
|
+
validTo: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export function attachOracle(
|
|
41
|
+
iasset: Uint8Array<ArrayBufferLike>,
|
|
42
|
+
collateralAsset: AssetClass,
|
|
43
|
+
priceInfo: IAssetPriceInfo,
|
|
44
|
+
priceOracleOref: OutRef | undefined,
|
|
45
|
+
pythStateOref: OutRef | undefined,
|
|
46
|
+
pythMessage: string | undefined,
|
|
47
|
+
pythConfig: PythConfig,
|
|
48
|
+
biasTime: bigint,
|
|
49
|
+
currentSlot: number,
|
|
50
|
+
lucid: LucidEvolution,
|
|
51
|
+
tx: TxBuilder,
|
|
52
|
+
): Promise<{ interval: Interval; referenceInputs: UTxO[] }> {
|
|
53
|
+
return match(priceInfo)
|
|
54
|
+
.returnType<Promise<{ interval: Interval; referenceInputs: UTxO[] }>>()
|
|
55
|
+
.with({ Delisted: P.any }, () => {
|
|
56
|
+
const currentTime = BigInt(
|
|
57
|
+
slotToUnixTime(lucid.config().network!, currentSlot),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// We want to make sure the transaction is valid within the bias time for interest tracking AND Pyth
|
|
61
|
+
// For validFrom, we take the higher of the two bias times
|
|
62
|
+
const validFrom = Number(currentTime - BigInt(biasTime / 2n));
|
|
63
|
+
// For validTo, we take the lower of the two bias times
|
|
64
|
+
const validTo = Number(currentTime + BigInt(biasTime / 2n));
|
|
65
|
+
|
|
66
|
+
return Promise.resolve({
|
|
67
|
+
interval: {
|
|
68
|
+
validFrom,
|
|
69
|
+
validTo,
|
|
70
|
+
},
|
|
71
|
+
referenceInputs: [],
|
|
72
|
+
});
|
|
73
|
+
})
|
|
74
|
+
.with({ OracleNft: P.any }, async () => {
|
|
75
|
+
if (!priceOracleOref) throw new Error('Missing price oracle');
|
|
76
|
+
|
|
77
|
+
const priceOracleUtxo = matchSingle<UTxO>(
|
|
78
|
+
await lucid.utxosByOutRef([priceOracleOref]),
|
|
79
|
+
(_) => new Error('Expected a single price oracle UTXO'),
|
|
80
|
+
);
|
|
81
|
+
const priceOracleDatum = parsePriceOracleDatum(
|
|
82
|
+
getInlineDatumOrThrow(priceOracleUtxo),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
interval: oracleExpirationAwareValidity(
|
|
87
|
+
currentSlot,
|
|
88
|
+
Number(biasTime),
|
|
89
|
+
Number(priceOracleDatum.expirationTime),
|
|
90
|
+
lucid.config().network!,
|
|
91
|
+
),
|
|
92
|
+
referenceInputs: [priceOracleUtxo],
|
|
93
|
+
};
|
|
94
|
+
})
|
|
95
|
+
.with(
|
|
96
|
+
{ DeferredValidation: { feedValHash: P.select() } },
|
|
97
|
+
async (feedValHash) => {
|
|
98
|
+
if (!pythMessage) throw new Error('Missing Pyth message');
|
|
99
|
+
if (!pythStateOref) throw new Error('Missing pyth state out ref');
|
|
100
|
+
|
|
101
|
+
const pythStateUtxo = matchSingle(
|
|
102
|
+
await lucid.utxosByOutRef([pythStateOref]),
|
|
103
|
+
(_) => new Error('Expected a single pyth state UTXO'),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const pythStateDatum = parsePythStateDatum(
|
|
107
|
+
getInlineDatumOrThrow(pythStateUtxo),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const pythFeedCfg = getPythFeedConfig(
|
|
111
|
+
pythConfig,
|
|
112
|
+
iasset,
|
|
113
|
+
collateralAsset,
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// Lookup PFV Validator
|
|
117
|
+
const pfvScriptRefUtxo = matchSingle(
|
|
118
|
+
await lucid.utxosByOutRef([
|
|
119
|
+
fromSystemParamsScriptRef(pythFeedCfg.pythFeedValScriptRef),
|
|
120
|
+
]),
|
|
121
|
+
(_) =>
|
|
122
|
+
new Error('Expected a single pyth feed validator Ref Script UTXO'),
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const derivedPythPrice = fromSysParamsDerivedPythPrice(
|
|
126
|
+
pythFeedCfg.params.config,
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
const price = derivePythPrice(derivedPythPrice, pythMessage);
|
|
130
|
+
|
|
131
|
+
const decodedMessage = decodePythMessage(fromHex(pythMessage));
|
|
132
|
+
const pricePayload = decodePriceUpdate(decodedMessage.payload);
|
|
133
|
+
const pythTimestamp = Number(pricePayload.timestampUs) / 1_000;
|
|
134
|
+
|
|
135
|
+
tx.withdraw(
|
|
136
|
+
credentialToRewardAddress(
|
|
137
|
+
lucid.config().network!,
|
|
138
|
+
scriptHashToCredential(toHex(pythStateDatum.withdraw_script)),
|
|
139
|
+
),
|
|
140
|
+
0n,
|
|
141
|
+
serialisePythUpdatesRedeemer([fromHex(pythMessage)]),
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
tx.withdraw(
|
|
145
|
+
credentialToRewardAddress(
|
|
146
|
+
lucid.config().network!,
|
|
147
|
+
scriptHashToCredential(toHex(feedValHash)),
|
|
148
|
+
),
|
|
149
|
+
0n,
|
|
150
|
+
serialisePythFeedRedeemer({
|
|
151
|
+
price: price,
|
|
152
|
+
auxiliaryData: Core.Data.fromCBORHex(Data.void()),
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
// 5 minutes - 20 seconds
|
|
157
|
+
const pythMaxDelay = 280 * 1000;
|
|
158
|
+
|
|
159
|
+
const validFrom = Number(pythTimestamp);
|
|
160
|
+
const validTo = Number(pythTimestamp + pythMaxDelay);
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
interval: {
|
|
164
|
+
validFrom: validFrom,
|
|
165
|
+
validTo: validTo,
|
|
166
|
+
},
|
|
167
|
+
referenceInputs: [pythStateUtxo, pfvScriptRefUtxo],
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
)
|
|
171
|
+
.exhaustive();
|
|
172
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { applyParamsToScript, SpendingValidator } from '@lucid-evolution/lucid';
|
|
2
|
+
import {
|
|
3
|
+
fromSystemParamsAssetLucid,
|
|
4
|
+
IAssetParamsSP,
|
|
5
|
+
} from '../../types/system-params';
|
|
6
|
+
import { _cdpValidator } from '../../validators/cdp-validator';
|
|
7
|
+
import { _iassetValidator } from '../../validators/iasset-validator';
|
|
8
|
+
|
|
9
|
+
import { Data } from '@lucid-evolution/lucid';
|
|
10
|
+
import { AssetClassSchema } from '../../types/generic';
|
|
11
|
+
|
|
12
|
+
const IAssetScriptParamsSchema = Data.Object({
|
|
13
|
+
upgradeToken: AssetClassSchema,
|
|
14
|
+
versionRecordToken: AssetClassSchema,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type IAssetScriptParams = Data.Static<typeof IAssetScriptParamsSchema>;
|
|
18
|
+
export const IAssetScriptParams =
|
|
19
|
+
IAssetScriptParamsSchema as unknown as IAssetScriptParams;
|
|
20
|
+
|
|
21
|
+
export const mkIAssetValidatorFromSP = (
|
|
22
|
+
params: IAssetParamsSP,
|
|
23
|
+
): SpendingValidator => {
|
|
24
|
+
return {
|
|
25
|
+
type: 'PlutusV3',
|
|
26
|
+
script: applyParamsToScript(_iassetValidator.cborHex, [
|
|
27
|
+
Data.castTo(
|
|
28
|
+
{
|
|
29
|
+
upgradeToken: fromSystemParamsAssetLucid(params.upgradeToken),
|
|
30
|
+
versionRecordToken: fromSystemParamsAssetLucid(
|
|
31
|
+
params.versionRecordToken,
|
|
32
|
+
),
|
|
33
|
+
},
|
|
34
|
+
IAssetScriptParams,
|
|
35
|
+
),
|
|
36
|
+
]),
|
|
37
|
+
};
|
|
38
|
+
};
|