@indigo-labs/indigo-sdk 0.1.19 → 0.1.21
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 +8 -3
- package/dist/index.d.mts +1298 -677
- package/dist/index.d.ts +1298 -677
- package/dist/index.js +4650 -2217
- package/dist/index.mjs +4592 -2192
- package/eslint.config.mjs +7 -1
- package/package.json +9 -4
- package/src/contracts/cdp/helpers.ts +167 -0
- package/src/contracts/cdp/scripts.ts +33 -0
- package/src/contracts/cdp/transactions.ts +1310 -0
- package/src/contracts/cdp/types.ts +161 -0
- package/src/contracts/cdp-creator/scripts.ts +39 -0
- package/src/{types/indigo/cdp-creator.ts → contracts/cdp-creator/types.ts} +6 -4
- package/src/contracts/collector/scripts.ts +32 -0
- package/src/contracts/collector/transactions.ts +44 -0
- package/src/contracts/execute/scripts.ts +48 -0
- package/src/contracts/execute/types.ts +57 -0
- package/src/contracts/gov/helpers.ts +157 -0
- package/src/contracts/gov/scripts.ts +34 -0
- package/src/contracts/gov/transactions.ts +1224 -0
- package/src/contracts/gov/types-new.ts +115 -0
- package/src/contracts/gov/types.ts +89 -0
- package/src/{helpers/interest-oracle.ts → contracts/interest-oracle/helpers.ts} +37 -9
- package/src/contracts/interest-oracle/scripts.ts +18 -0
- package/src/contracts/interest-oracle/transactions.ts +149 -0
- package/src/{types/indigo/interest-oracle.ts → contracts/interest-oracle/types.ts} +1 -1
- package/src/contracts/lrp/scripts.ts +27 -0
- package/src/contracts/{lrp.ts → lrp/transactions.ts} +23 -23
- package/src/{types/indigo/lrp.ts → contracts/lrp/types.ts} +3 -3
- package/src/{scripts/one-shot-policy.ts → contracts/one-shot/scripts.ts} +1 -1
- package/src/contracts/{one-shot.ts → one-shot/transactions.ts} +3 -3
- package/src/contracts/poll/helpers.ts +55 -0
- package/src/contracts/poll/scripts.ts +72 -0
- package/src/contracts/poll/types-poll-manager.ts +38 -0
- package/src/contracts/poll/types-poll-shard.ts +38 -0
- package/src/contracts/poll/types-poll.ts +88 -0
- package/src/{scripts/price-oracle-validator.ts → contracts/price-oracle/scripts.ts} +1 -4
- package/src/contracts/price-oracle/transactions.ts +112 -0
- package/src/{types/indigo/price-oracle.ts → contracts/price-oracle/types.ts} +16 -4
- package/src/{helpers/stability-pool-helpers.ts → contracts/stability-pool/helpers.ts} +110 -6
- package/src/contracts/stability-pool/scripts.ts +46 -0
- package/src/contracts/stability-pool/transactions.ts +660 -0
- package/src/contracts/stability-pool/types-new.ts +208 -0
- package/src/contracts/stability-pool/types.ts +42 -0
- package/src/contracts/staking/helpers.ts +116 -0
- package/src/contracts/staking/scripts.ts +41 -0
- package/src/contracts/staking/transactions.ts +268 -0
- package/src/contracts/staking/types-new.ts +81 -0
- package/src/contracts/staking/types.ts +41 -0
- package/src/contracts/treasury/scripts.ts +37 -0
- package/src/contracts/treasury/transactions.ts +44 -0
- package/src/contracts/treasury/types.ts +55 -0
- package/src/contracts/version-registry/scripts.ts +29 -0
- package/src/contracts/version-registry/types-new.ts +19 -0
- package/src/{types/indigo/version-record.ts → contracts/version-registry/types.ts} +1 -1
- package/src/contracts/vesting/helpers.ts +267 -0
- package/src/index.ts +38 -33
- package/src/types/evolution-schema-options.ts +16 -0
- package/src/types/generic.ts +78 -60
- package/src/types/on-chain-decimal.ts +22 -0
- package/src/types/system-params.ts +22 -11
- package/src/utils/bigint-utils.ts +7 -0
- package/src/{helpers → utils}/helper-txs.ts +1 -0
- package/src/utils/time-helpers.ts +4 -0
- package/src/{helpers/helpers.ts → utils/utils.ts} +0 -10
- package/src/{helpers → utils}/value-helpers.ts +10 -0
- package/src/{scripts → validators}/cdp-creator-validator.ts +4 -50
- package/src/{scripts → validators}/cdp-validator.ts +3 -5
- package/src/{scripts → validators}/collector-validator.ts +2 -3
- package/src/{scripts/version-registry.ts → validators/execute-validator.ts} +3 -11
- package/src/{scripts/gov-validator.ts → validators/governance-validator.ts} +3 -40
- package/src/{scripts → validators}/interest-oracle-validator.ts +4 -20
- package/src/validators/lrp-validator.ts +7 -0
- package/src/validators/poll-manager-validator.ts +7 -0
- package/src/{scripts → validators}/poll-shard-validator.ts +3 -43
- package/src/{scripts → validators}/stability-pool-validator.ts +4 -57
- package/src/{scripts → validators}/staking-validator.ts +2 -3
- package/src/{scripts → validators}/treasury-validator.ts +2 -3
- package/src/{scripts → validators}/version-record-policy.ts +4 -23
- package/src/validators/version-registry-validator.ts +7 -0
- package/tests/cdp.test.ts +1565 -0
- package/tests/datums.test.ts +125 -108
- package/tests/endpoints/initialize.ts +240 -338
- package/tests/gov.test.ts +1874 -0
- package/tests/hash-checks.test.ts +26 -21
- package/tests/indigo-test-helpers.ts +1 -55
- package/tests/initialize.test.ts +10 -5
- package/tests/interest-calculations.test.ts +18 -18
- package/tests/interest-oracle.test.ts +20 -18
- package/tests/lrp.test.ts +180 -78
- package/tests/mock/assets-mock.ts +59 -0
- package/tests/queries/cdp-queries.ts +144 -0
- package/tests/queries/collector-queries.ts +26 -0
- package/tests/queries/execute-queries.ts +46 -0
- package/tests/queries/governance-queries.ts +19 -16
- package/tests/queries/iasset-queries.ts +46 -23
- package/tests/queries/interest-oracle-queries.ts +3 -6
- package/tests/queries/lrp-queries.ts +2 -2
- package/tests/queries/poll-queries.ts +97 -0
- package/tests/queries/price-oracle-queries.ts +5 -22
- package/tests/queries/stability-pool-queries.ts +10 -8
- package/tests/queries/staking-queries.ts +28 -19
- package/tests/queries/treasury-queries.ts +19 -0
- package/tests/stability-pool.test.ts +186 -71
- package/tests/staking.test.ts +30 -23
- package/tests/test-helpers.ts +11 -2
- package/tests/utils/asserts.ts +13 -0
- package/tests/utils/index.ts +50 -0
- package/tsconfig.json +3 -1
- package/vitest.config.ts +1 -1
- package/.github/workflows/test.yml +0 -44
- package/src/contracts/cdp.ts +0 -748
- package/src/contracts/collector.ts +0 -98
- package/src/contracts/gov.ts +0 -1
- package/src/contracts/interest-oracle.ts +0 -149
- package/src/contracts/stability-pool.ts +0 -692
- package/src/contracts/staking.ts +0 -348
- package/src/contracts/treasury.ts +0 -112
- package/src/helpers/asset-helpers.ts +0 -57
- package/src/helpers/staking-helpers.ts +0 -94
- package/src/helpers/time-helpers.ts +0 -4
- package/src/scripts/execute-validator.ts +0 -52
- package/src/scripts/lrp-validator.ts +0 -40
- package/src/scripts/poll-manager-validator.ts +0 -52
- package/src/types/indigo/cdp.ts +0 -88
- package/src/types/indigo/execute.ts +0 -21
- package/src/types/indigo/gov.ts +0 -51
- package/src/types/indigo/poll-manager.ts +0 -21
- package/src/types/indigo/poll-shard.ts +0 -16
- package/src/types/indigo/stability-pool.ts +0 -233
- package/src/types/indigo/staking.ts +0 -99
- /package/src/{types/one-shot.ts → contracts/one-shot/types.ts} +0 -0
- /package/src/{helpers/price-oracle-helpers.ts → contracts/price-oracle/helpers.ts} +0 -0
- /package/src/{helpers → utils}/indigo-helpers.ts +0 -0
- /package/src/{helpers → utils}/lucid-utils.ts +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyParamsToScript,
|
|
3
|
-
applySingleCborEncoding,
|
|
4
|
-
ScriptType,
|
|
5
|
-
SpendingValidator,
|
|
6
|
-
} from '@lucid-evolution/lucid';
|
|
7
|
-
import { castExecuteParams, ExecuteParams } from '../types/indigo/execute';
|
|
8
|
-
import { ExecuteParamsSP, fromSystemParamsAsset } from '../types/system-params';
|
|
9
|
-
|
|
10
|
-
const executeValidatorData = {
|
|
11
|
-
type: 'PlutusV2' as ScriptType,
|
|
12
|
-
description: '',
|
|
13
|
-
cborHex:
|
|
14
|
-
'59239701000032323232323232322232323232323232323232323232322322533301432325333016300e301837546038603a0042646464646464646464646464646464646464646464646464a66605c66002920125476f7620696e707574206d75737420757365207468652072696768742072656465656d657200533302e00c132323375e00498103d87b8000325333030302d00113232323232323232533303c303f00213232498c0a8008c0ac00c58c0f4004c0f4008c0ec004c0ec008dd7181c800981c8011bad3037001303337540042a666060605000226464a66606c60720042930b1bad3037001303337540042a666060604a0022a66606860666ea80085261615333030302400115333034303337540042930b0b18189baa0013300230153031375401a02c29444c94ccc0bccc0092401174d697865642070726f746f636f6c2076657273696f6e73003370e6eb4c02cc0c8dd50051bad30013032375405a2646464a6660646600a9212243616e206f6e6c7920636f6e73756d65206f6e65207570677261646520746f6b656e00302a300133301301b301630353754062980103d87980001533303233005491224d7573742065786563757465206166746572206566666563746976652064656c617900325333033302b30353754002266e20cdc01bad300f303637540626eb4c03cc0d8dd5180b981b1baa00e375a6072606c6ea8004528180c981a9baa3019303537546010606a6ea807454ccc0c8cc0152411143616e6e6f7420626520657870697265640000713232533233035332253330373034303937540042a66607601e2a66070921475768656e2066756e64732066726f6d207472656173757279207265717565737465642069742068617320746f207370656e642061207574786f2066726f6d20747265617375727900161533303b303e00f13232300500232533303930360011533303d303c37540042930b0a99981c98188008a99981e981e1baa00214985854ccc0e4c0b800454ccc0f4c0f0dd50010a4c2c2a666072605a0022a66607a60786ea800852616153330393370e90040008a99981e981e1baa00214985854ccc0e4cdc3a40140022a66607a60786ea80085261616303a375400266016603c60746ea8c0f403c00454cc0e1241475768656e2066756e64732066726f6d207472656173757279207265717565737465642069742068617320746f207370656e642061207574786f2066726f6d207472656173757279001613300a49014b5768656e206e6f207472656173757279207769746864726177616c207265717565737465642069742063616e2774207370656e6420616e79207574786f2066726f6d207472656173757279003034300600f3002303837540666eacc00cc0e0dd501009980424812b4661696c20746f2065786563757465207570677261646520696e20657865637574696e6720706572696f640032323232323232323232323232323232325332330473301a49012c54686520646174756d206f6620676f7665726e616e6365206d757374207570646174652070726f7065726c7900323253233304a304700213333300d00730233304f0014bd701802198279919191819998291829801998291829801198291829800998291ba8301e375a604860a06ea80a0c150c150004c14c004c148004c134dd5002a5eb80c030c0c4c134dd5024a6103d87a80001533304a303f00213333300d00730233304f0014bd7018021982799181899828182880099828182898271baa00430523052001304d375400a97ae0300c3031304d375409298103d87a80001533304a303e00213333300d00730233304f0014bd7018021982799191819198289829001198289829000998289ba8301d375a6050609e6ea809cc14cc14c004c148004c134dd5002a5eb80c030c0c4c134dd5024a6103d87a80001533304a302c00613333300d00730233304f0014bd70180219827802a5eb80c030c0c4c134dd5024a60103d87a8000133304a0284a0944c0bccc138c0c0c130dd5181818261baa302d304c37540506609c980103d87a80004bd7018251baa001302b304a375408a2a66608e66034920122546865207472616e73616374696f6e206d757374206d696e742070726f7065726c79003375e6e98c8cc004004dd5980d18259baa03322533304d00114bd6f7b63009919191929998269808801080189982919bb037520046e98004cc01801800cdd598278019bae304d0023051002304f001374c64a666090608a00226601c6601c6014603e60966ea811cc028c090c12cdd502398079805181618259baa04715333048303c00113300e300a301a304b375408e601e6014605860966ea811c4c03cc028c0b0c12cdd502398249baa302b304a375408a2a66608e6603492119496e636f727265637420494173736574207370656e64696e6700325333048304000114a22a666090608a00229444c114c8c8cc004004020894ccc13c004520001337006600400460a4002660206eacc0bcc138dd5181798271baa30510010033024304b375408e60926ea8c0acc128dd502289919299199825182380109919191919191919191919191919191919191919191919191929998319981b24812153746162696c697479506f6f6c206f757470757420697320696e636f72726563740033333026020303c33068304933068303c330683069306a306a306a306a306a306a306637540c497ae0330684c103d87a80004bd7025eb80c074cc1a0c124cc1a0c124cc1a0dd480c198342611dd8799fd8799f1b0de0b6b3a7640000ffd8799f00ffd8799f00ff0000ff00330684c10ca1d8799f0000ffd8799f00ff004bd7025eb812f5c0604a607460cc6ea818930103d87a8000153330633060375a607460cc6ea80f84cc0d92412370726f706f73656420694173736574206f757470757420697320696e636f727265637400330014a2980103d87a8000133036490125496e636f72726563746c7920636f6e73756d6564207265666572656e6365206961737365740032325333069306c0021325333066305e3068375400226464a6660d860de00426464a6660d460ce0022a6660d464a6660de60dc0022a6660d660c660da002294454ccc1acc1a0c1b40045280b0b1baa3070307130713071307130713071307130713071307130713071306d37540062a6660d46607a92012370726f706f73656420694173736574206f757470757420697320696e636f727265637400330084a260a0660de60a260da6ea800d2f5c026607a92123636f6e73756d656420694173736574206f757470757420697320696e636f7272656374003333302d02700930243306f30433306f323232323232323232323232305c3307b307c00c3307b307c00b3307b307c00a3307b307c0093307b307c0083307b307c0073307b307c0063307b307c0053307b307c0043307b307c0033307b307c0023307b307c0013307b3330764a0980103d87a80004c0103d8798000307d307d001307c001307b001307a00130790013078001307700130760013075001307400130730013072001306d375400697ae04bd701816182318369baa0694c0103d87a800014a0294054ccc1a8c17c00454ccc1a8c94ccc1acc1a0c1b4dd50008981b998198101bae3071306e37540022944c0a8c1b4dd50018a9998351981ea492370726f706f73656420694173736574206f757470757420697320696e636f727265637400330084a0605460da6ea800c4cc0f524123636f6e73756d656420694173736574206f757470757420697320696e636f7272656374003333302d02700930243306f30433306f323232323232323232323232305c3307b307c00c3307b307c00b3307b307c00a3307b307c0093307b307c0083307b307c0073307b307c0063307b307c0053307b307c0043307b307c0033307b307c0023307b307c0013307b307c307d0013307b305c3307b375205697ae04bd70183e000983d800983d000983c800983c000983b800983b000983a800983a0009839800983900098369baa0034bd7025eb80c0b0c118c1b4dd5034a60103d87a800014a0294054cc1ad2411a537563682069617373657420616c7265616479206578697374730016306b37546606203c6eb8c140c1b0dd500118148008b183680098349baa001163042304130683754609260d06ea800458c1a8004ccc110dd6182518331baa04e303f306637540c4980103d879800014a0446666604e042006603c660d2607a660d26094660d26ea4064cc1a4c0f4cc1a405d2f5c0660d202a660d2026660d2022660d201e660d201a660d2016660d2012660d200e660d200a660d2008660d26660c8004980103d87a80004c0103d8798000330690014bd7025eb812f5c0604c608060ce6ea818d30103d87a8000303a33066304733066018330664c0103d87a80004bd7025eb80c198c19c008c194004c194008c18c004c18c008c184004c184008c17c004c17c008c174004c174008c16c004c16c008c164004c164008c15c004c15c008c154004c154008c14c004c14c008dd7182880098269baa0031533304a30420021323232323232323232323232323232323232323232323232325333067306a0021325333064305c3066375400226464a6660d460da004264a6660ce6607492011a694173736574206f757470757420697320696e636f7272656374003333302a02430403306c304d3306c01e3306c4c103d87a80004bd7025eb80c084cc1b0c100cc1b0c134cc1b0dd480e1983600d1983600c1983600b1983600a1983600919836008198360071983600619836005198360041983600398371837183718371837183718371837183718371837183718351baa0024bd7025eb80c0a4c10cc1a8dd5033260103d87a8000153330673303a4911b5370656e6420696e76616c696420694173736574206f7574707574003371e6eb8c138c1a8dd500100e0a9998339981d2491f43616e6e6f74206d6f6469667920612064656c697374656420694173736574005333067306430693754609660d46ea800854cc1a12411f43616e6e6f74206d6f6469667920612064656c697374656420694173736574001614a226607492011d4d6967726174696e67206e6f6e2d757067726164656420494173736574003375e609c60d46ea8c138c1a8dd5182598351baa00501e14a0294052818138008b183580098339baa001163040303f30663754608e60cc6ea800458c1a0004ccc10807cc0f4c190dd503026103d879800030663067002306500130650023063001306300230610013061002305f001305f002305d001305d002305b001305b00230590013059002305700130570023055001305500230530013053002375c60a2002609a6ea800c54ccc128c0f80084c8cc07924012176657273696f6e5265636f7264206f757470757420697320696e636f7272656374003333300e0083024330503031330503024330503021304e375409497ae0330504c103d87a80004bd7025eb80c014cc140c0c4cc140c144004cc140dd319198008009bab3052305300222533305100114bd6f7b6300998291919bb0305000130353051375460a200260a60026600400460a800297ae04bd701806980e98271baa04a4c0103d87a8000304d375460a0609a6ea800c54ccc128c0fc0085288a5130223304e3016304c375409097ae0304a3754002605660946ea81145280a50374a90020a5032323232302f3304e304f0043304e304f0033304e304f0023304e304f0013304e304f30500013304e37506644a66609666e2000400840044008cdc01bad3016304c375404800a66e092082d1cc044820225e92f5c0609e002609c002609a00260906ea8080c94ccc114c108c11cdd5000899805191980080099198008009bac302b304a3754609a60946ea800c894ccc13000452f5c026609a6e9cc8c8cc13cc140008cc13cc140004cc13cc140c1440052f5c060a000260966ea8c138004cc008008c13c004894ccc12c00452f5bded8c02664464666444a66609a6094002200a26666602e00a0066464004646600200200444a6660a8002293099299982a8008a4c26464a6660a660a060aa6ea8cc06cdd7182a982c8021bae3055002133005005330580020011533054491326b65797320696e206173736f63696174697665206c697374206172656e277420696e20617363656e64696e67206f72646572001630590023057001305700133052337606ea4008dd4000a5eb7bdb180888c94ccc144c068004530103d87a80001303733056374c00297ae03333301b001005004222325333054305100114c103d87a80001303a33059375000297ae03370000200403002a6eb8c14000cdd718280009bad3050305100130500023758609a00266004004609c002602660906ea8110520003011304737540846eb0c124c128c128008dd6182400098221baa02c23047304830483048304830483048304830483048304830483048304800125333040303d30423754002264646464646464646464646464646464646464646464646464646464a6660c060c6004264646464646464646464646493192999834183280089919299983718388010a4c2c6eb8c1bc004c1acdd50068a99983418300008a99983618359baa00d14985858c1a4dd5006182f807982f008182e808982e009182d809982d00a182c80a982c00b182b80b982c80c182980c8b1830800983080119299982f182e8008a99982d1829182e0008a511533305a3057305c00114a02c2c6ea8c17c004c17c008c174004c174008c16c004c16c008c164004c164008c15c004c15c008c154004c154008c14c004c14c008c144004c144008c13c004c13c008c134004c134008c12c004c12c008c124004c124008dd7182380098219baa0011623322533304130394800052f5bded8c0264646600200297adef6c60225333048001133049337606ea4014dd3001a5eb7bdb1804c8c8c8c94ccc120c050cc0400240084cc134cdd81ba9009374c00e00a2a66609066e3c0240084cc134cdd81ba9009374c00e00626609a66ec0dd48011ba600133006006003375660940066eb8c120008c130008c128004c8cc0040052f5bded8c044a66608e00226609066ec0dd4801a6010101004bd6f7b630099191919299982398099980780380109982619bb0375200e981010100005153330473371e00e00426609866ec0dd4803a6101010000313304c337606ea4008dd4000998030030019bad3049003375c608e004609600460920026eb8c098c108dd50009bae3023304237540024444464660020026604c00ca6660866080608a6ea80144c88cdd7981618241baa302c304837540020046092608c6ea80144c88cdd7981618241baa00100230493046375400a44a66609000229404c94ccc114c94ccc118cdd7981118249baa001007132533304b00114a22a666096609c0022646464a666094601c6eb8c14000c54ccc128c03800454ccc128c11cc130dd50048a99982519b89480000084cdc48012410137dc0429404cdc4a400000429405281bae304f3050002375a609c609e609e0026eb0c1340045281919800800998069bab302b304a3754004601c00e44a666098002297ae01323332223233001001003225333052001100313233054374e660a86ea4018cc150dd49bae30510013305437506eb4c1480052f5c06600600660ac00460a80026eb8c12c004dd5982600099801801982800118270008a50304b00214a226600600600260960026e3d2210022333022002375c604860806ea8004dd7181098201baa00122323330010010030022225333043002100113233300400430470033333300a002375c60840026eacc10c004888c94ccc110c0340045300103d87a80001302a33049374c00297ae032333001001003002222533304a0021001132333004004304e00333333012002375c60920026eb4c128004888c94ccc12cc1200045300103d87a80001303133050375000297ae03370000400201e6098004010608a0044646600200200444a666080002297adef6c6013233042337606ea4dd7181f8009ba632330010013756608200444a666086002297adef6c6013233045337606ea4dd718210009ba83370290001bad30430013300300330470023045001330030033044002304200122533303a33720004002298103d87980001533303a3371e0040022980103d87a800014c103d87b80002533303c00114a2294088888c8cc004004018894ccc1040044cc108cdd81ba9006374c00a97adef6c601323232325333041300d3300700a002133046337606ea4028dd30048028a99982099b8f00a0021325333042303f3044375400226608e66ec0dd4805982418229baa001004100433300800a009001133046337606ea4008dd3000998030030019bab3043003375c6082004608a004608600244444646600200200c44a66608000226608266ec0dd48031ba80054bd6f7b630099191919299982018061980380500109982299bb037520146ea002401454ccc100cdc78050010992999820981f18219baa001133046337606ea402cc11cc110dd5000802080219980400500480089982299bb037520046ea0004cc01801800cdd698210019bae304000230440023042001375e98103d879800014a046074607660766076607660760024607260746074607460746074607460746074607400229405280a5030010012253330360011480004c00ccc008008c0e4004dc02400429408c0d4c0d8c0d8c0d8c0d8004528112999817999817800a504a22a66060004200220024464a66605e605860626ea80044c0d4c0c8dd50008a9981824917436f756c64206e6f742066696e642072656465656d6572001632323300100100322533303500114c0103d87a8000132323253330343375e00c606c006260346607200297ae01330050050023036002303900230370013007330330024bd70192999816181218171baa0011337126eb4c0c8c0bcdd500099b80375a6006605e6ea80a8dd6980198179baa3010302f375400e2940c048c0b8dd5180798171baa3001302e375402c460626064606460646064606460646064002460606062606260620026466018024466ebcc044c0b4dd5180898169baa300e302d375400200460026605a605c605e605e605e605e605e605e605e605e60566ea809d2f5c06e95200253330263023302837540022646464646464646464646464a66606c60720042649318140048b1bad30370013037002375a606a002606a0046eb4c0cc004c0cc008dd698188009818801181780098178011bad302d001302937540022c6004600260506ea8c024c0a0dd5002118159816181600092999812180c98131baa0011302a302737540022a6604a921134e6f7420616e20696e6c696e6520646174756d0016300430243754604a004604600264a66604a002264a66604c0022a66046920130457870656374656420476f7620696e7075742065697468657220617320696e707574206f72207265662e20696e7075740016153330263029001133760605000266604494130103d87a80004c0103d8798000153302349130457870656374656420476f7620696e7075742065697468657220617320696e707574206f72207265662e20696e70757400163330023758600a60486ea8030c020c090dd501026103d8798000153330253028001133760604e00266604294530103d87a80004c0103d879800013253330260011533023490130457870656374656420476f7620696e7075742065697468657220617320696e707574206f72207265662e20696e7075740016153330263029001133760605000266604494130103d87a80004c0103d8798000153302349130457870656374656420476f7620696e7075742065697468657220617320696e707574206f72207265662e20696e70757400163330023758600a60486ea8030c020c090dd501026103d879800033300100930073023375403e980103d8798000222323300600423002300830273754002a666044603e60486ea800448c06cccc020dd5980398131baa001375c6014604c6ea800cdd7180398131baa0031230053330083756600e604c6ea8004dd7180518131baa003375c600e604c6ea800cdc42400044646600200200644a66604a002297ae01323253330233005002133028002330040040011330040040013029002302700123023302400122232533301f3017302137540022900009bad30253022375400264a66603e602e60426ea8004530103d87a8000132330010013756604c60466ea8008894ccc094004530103d87a8000132323253330243371e00e6eb8c09800c4c028cc0a4dd4000a5eb804cc014014008dd698130011814801181380099198008008021129998120008a6103d87a8000132323253330233371e00e6eb8c09400c4c024cc0a0dd3000a5eb804cc014014008dd59812801181400118130009ba5480008c080004dd5980f180f980f980f980f980f980f980f980f980f8011bac301d001301937540022c6036002602e6ea8004526136563253330133010301500115333017301600114985858dd5000a999808180698091baa00e13232323232323232323232325333020302300213232498c038008c03c02458c084004c084008dd6980f800980f8011bad301d001301d002375a60360026036004603200260320046eb4c05c004c04cdd50070b1192999808980700089919299980b980d00109924ca6660266020602a6ea80044c8c8c8c94ccc06cc0780084c8c92633013002253330193016301b37540022646464646464a666046604c0042930b1bad30240013024002375c604400260440046eb8c080004c070dd50008b299980b980a180c9baa003132323232533301f302200213232498c94ccc074c0680044c8c94ccc08cc0980084c926325333020301d0011323253330263029002132498c05000458c09c004c08cdd50010a999810180c0008991919191919299981518168010a4c2c6eb4c0ac004c0ac008dd6981480098148011bad3027001302337540042c60426ea800458c090004c080dd50018a99980e980a8008a99981098101baa00314985858c078dd500118068018b18100009810001180f000980d1baa00316163758603800260380046034002602c6ea80045858c060004c050dd50010a99980898048008a99980a980a1baa00214985858c048dd50009192999808180680089919299980b180c8010a4c2c6eb8c05c004c04cdd50010a999808180400089919299980b180c8010a4c2c6eb8c05c004c04cdd50010b18089baa001232533300f300c0011323232323232323232323232323232323232323232323232533302b302e00213232323232323232323232498c0a802cc0a4030c0a0034c09c038c09803cc094040c090044c08c048c08804cc090050c08405458c0b0004c0b0008c0a8004c0a8008c0a0004c0a0008c098004c098008c090004c090008c088004c088008c080004c080008c078004c078008c070004c070008c068004c068008c060004c060008dd7180b00098091baa0021533300f30070011323232323232323232323232323232323232323232323232533302b302e00213232323232323232323232498c0a802cc0a4030c0a0034c09c038c09803cc094040c090044c08c048c08804cc090050c07805458c0b0004c0b0008c0a8004c0a8008c0a0004c0a0008c098004c098008c090004c090008c088004c088008c080004c080008c078004c078008c070004c070008c068004c068008c060004c060008dd7180b00098091baa0021533300f30040011323253330153018002132498c01c00458c058004c048dd50010a999807980180089919299980a980c00109924ca666022601c60266ea80044c8c8c8c94ccc064c0700084c926330100012323253330183015301a375400226464a66603c60420042930b1bae301f001301b37540022c60340046eb8c06000458dd5980d000980d0011bad3018001301437540022c2c602c00260246ea800854ccc03ccdc3a401000226464a66602a60300042930b1bae3016001301237540042c60206ea8004dc3a400c6e1d20042533300b3008300d375400226464646464646464646464646464646464646464a666046604c00426493180c0058b1bad30240013024002375a604400260440046eb4c080004c080008dd6980f000980f0011bad301c001301c002301a001301a002375a603000260300046eb4c058004c058008dd6980a000980a0011bad3012001300e37540022c464a666016601000226464a66602260280042649318030008b180900098071baa0021533300b30030011323253330113014002132498c01c00458c048004c038dd50010b18061baa001370e900112999804180298051baa00113232533300e3011002149858dd6980780098059baa001162533300730043009375400226464a66601a60200042649318028008b180700098051baa0011622323300100100322533300d00114984c8cc00c00cc044008c00cc03c00494ccc014c008c01cdd5000899191919299980698080010a4c2c6eb8c038004c038008dd7180600098041baa00116370e90002b9a5738aae7555cf2ab9f5740ae855d101',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const mkExecuteValidator = (
|
|
18
|
-
params: ExecuteParams,
|
|
19
|
-
): SpendingValidator => {
|
|
20
|
-
return {
|
|
21
|
-
type: executeValidatorData.type,
|
|
22
|
-
script: applySingleCborEncoding(
|
|
23
|
-
applyParamsToScript(executeValidatorData.cborHex, [
|
|
24
|
-
castExecuteParams(params),
|
|
25
|
-
]),
|
|
26
|
-
),
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const mkExecuteValidatorFromSP = (
|
|
31
|
-
params: ExecuteParamsSP,
|
|
32
|
-
): SpendingValidator => {
|
|
33
|
-
return {
|
|
34
|
-
type: executeValidatorData.type,
|
|
35
|
-
script: applySingleCborEncoding(
|
|
36
|
-
applyParamsToScript(executeValidatorData.cborHex, [
|
|
37
|
-
castExecuteParams({
|
|
38
|
-
govNFT: fromSystemParamsAsset(params.govNFT),
|
|
39
|
-
upgradeToken: fromSystemParamsAsset(params.upgradeToken),
|
|
40
|
-
iAssetToken: fromSystemParamsAsset(params.iAssetToken),
|
|
41
|
-
stabilityPoolToken: fromSystemParamsAsset(params.stabilityPoolToken),
|
|
42
|
-
versionRecordToken: fromSystemParamsAsset(params.versionRecordToken),
|
|
43
|
-
cdpValHash: params.cdpValHash,
|
|
44
|
-
sPoolValHash: params.sPoolValHash,
|
|
45
|
-
versionRegistryValHash: params.versionRegistryValHash,
|
|
46
|
-
treasuryValHash: params.treasuryValHash,
|
|
47
|
-
indyAsset: fromSystemParamsAsset(params.indyAsset),
|
|
48
|
-
} as ExecuteParams),
|
|
49
|
-
]),
|
|
50
|
-
),
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyParamsToScript,
|
|
3
|
-
ScriptType,
|
|
4
|
-
SpendingValidator,
|
|
5
|
-
} from '@lucid-evolution/lucid';
|
|
6
|
-
import { castLrpParams, LRPParams } from '../types/indigo/lrp';
|
|
7
|
-
import { fromSystemParamsAsset, LrpParamsSP } from '../types/system-params';
|
|
8
|
-
|
|
9
|
-
/*Automatically generated by the ctl-export.sh script in aiken smart contracts repository*/
|
|
10
|
-
const lrpValidatorData = {
|
|
11
|
-
type: 'PlutusV2' as ScriptType,
|
|
12
|
-
description: 'Generated by Aiken',
|
|
13
|
-
cborHex:
|
|
14
|
-
'5916f80100003232323232323232322223232323232322533300b323232533300e30083011375400226464646464646464646464646464646464646464646464646464a66605060480322646464646464646464646464a6660726078004264a66606a605e60706ea80044c8c94ccc0f0c0fc0084c8c8c8c94ccc0ecc0dcc0f8dd50008991919299981f181d18209baa001132533303f3302149110496e636f727265637420694173736574003371e6eb8c0a8c10cdd50049bae30243043375407a264a6660806664446464944c8ccc00400406d2f5bded8c0444a66609800420022666006006609e00464a66609066ebcc0ccc130dd5181998261baa302d304c37540020102646464a666096608e00226601000a6eb4c148c13cdd50018a999825982280089919191919192999828a99982899982899b8f375c60b0008020941288a51153330513330513375e004032941288a5113330513375e01e002941288a99829a4812452656465656d417578207573657320696e636f7272656374206173736574207374617473001613300e00b005305730580023056001305600130553055002375a60a6002609e6ea800c54cc1352412d4578706563746564206f6e6c792052656465656d2072656465656d65727320666f72204c525020696e707574730016304d3754004608200266046606660986ea800405c4008c13800888c8cc00400400c894ccc1300044cc134cdd81ba800333048499300103d87980004bd6f7b6300991919192999825981da99982599b8800700214c103d87980001533304b3371000400e2980103d87b800014c103d87a8000133051337606ea001ccc131264c103d87980000051533304b3370e00e004264a6660986090609e6ea80044cc148cdd81ba80083304d32498c14cc140dd5000a60103d8798000004100453304d49126436f6e74696e75696e67206f75747075747320646f75626c6520736174697366616374696f6e0016133051337606ea0008cc130005300103d87980003300600600332498c13800cdd6982600118280011827000981598221baa004375c605660886ea8028c004c110dd50050999999981001f80280100201f004180098221baa00a14a04608e6090609060906090609060906090609060900022940c114c108dd50008b1980d80780a981398201baa3021304037540026084607e6ea800458cc05c0400b0c0540dcc94ccc0e4c0d4c0f0dd500089820181e9baa001132533303a32533303b3035303e3754002266e24dd69810181f9baa002375a6084607e6ea800454cc0f524124496e636f7272656374207472616e73616374696f6e2076616c69646974792072616e676500163025303e3754603e607c6ea802854cc0f12401174f7261636c652063616e27742062652065787069726564001613025303e37540026464004a666074606c607a6ea80044c8c8c8c94ccc10cc1180084c926303900316375a608800260880046084002607c6ea800458c048c074c0f4dd5180f181e9baa32533303f001153303c49012145787065637465642065786163746c79206f6e65206f7261636c6520696e70757400161533303f304200113041001153303c49012145787065637465642065786163746c79206f6e65206f7261636c6520696e707574001633301300d3040303d37546080607a6ea8005300103d8798000301d303c375400464a666070606860766ea80084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc164c1700084c8c8c8c8c8c8c8c8c8c8c8c926325333060305c001132325333067306a002149858dd7183400098321baa00d15333060305a001153330653064375401a2930b0b18311baa00c305900f30580103057011305601230550133054014305301530520163051017301e018325333055305100113232533305c305f002132498c14800458c174004c164dd500d0a99982a982780089919299982e182f80109924ca6660ae60a660b46ea80044c8c94ccc178c1840084c926302200116305f001305b37540022c2c60ba00260b26ea806858c15cdd500c8b182d000982d00119299982b982b0008a9998291826182a8008a5115333052304e305500114a02c2c6ea8c160004c160008c158004c158008c150004c150008c148004c148008c140004c140008c138004c138008c130004c130008c128004c128008c120004c120008c118004c118008c110004c110008c108004c108008dd71820000981e1baa00216253330383034303b3754002264646464a66608260880042930b1bae30420013042002375c608000260786ea80045858c0f4004c0e4dd50008b1806980c181c1baa3019303837540022c607400266601800c602e606c6ea80c5300103d87980003756607060726072004606e002606e606e606e606e606e0046eb0c0d4004c0d4008dd6181980098198011bac3031001302d375403a6eb4c0bcc0b0dd50128a999814181100c899191919191919191919191919191919299981c181a181d9baa0011323232533303b3037303e375400226464a66607a607260806ea80044c8c94ccc110c11c0084c94ccc100c0f0c10cdd5000899299982099811a4810c57726f6e6720696173736574003371e0286eb8c098c114dd501f8a99982099811a491e52656465656d207574786f2066726f6d2077726f6e672061646472657373003375e6058608a6ea8c0b0c114dd5181318229baa006302c304537540102666666604208001200201007e0240222940528182398221baa001163301d00b01616375a608a00260826ea800458cc05c04401cc108c0fcdd50008b1980b8040079812181e9baa301e303d3754002607e60786ea800458cc0500140a4c0480d0dd5981e181e981e981e981e981e981e981e8011bac303b001303b303b00237586072002606a6ea8094c0dcc0e0008c0d8004c0d8008dd7181a000981a001181900098190011bad3030001302c375404a264a66605260440342646601892011754582069736e74207369676e6564206279206f776e657200330023758606260646064606460646064606460646064605c6ea8078dd7180a98171baa02830050271333232322232323232325333033302f30363754002264a666068605c606e6ea80044c8c8c94ccc0f0c0fc0084c8c8c94ccc0e8c0d8c0f4dd500089980e19807998201ba937309201084d697373696e6720003304037526e60038cc100dd49b984901172075706772616465206d696e74696e6720706f6c696379004bd70249003301230103302300948900375c6082607c6ea800454cc0f0cc03ccc100dd49b98491084d697373696e6720003304037526e60038cc100dd49b9849010d20757067726164652070617468004bd70249001632533303a3034303d3754002298103d87a8000130223304037526eb8c0f8c8cdd81821000982118218009bac3041303e375400297ae032330010013756603e607c6ea800c894ccc1000045300103d87a800013232533303d3371e6eb8c1000080244c094cc10cdd399821982000119821982080125eb812f5c026600800800260880046084002a666070606860766ea80044c8c8c8c94ccc104c1100084c926323300100100222533304300114984c8cc00c00cc11c008c8c8dd718220011bae30420013045001163756608400260840046eb4c100004c0f0dd50008b1808180d981d9baa301c303b37540022c607a00266601e00a01098103d8798000375c607660706ea800458c078c0dcdd5180f181b9baa3018303737546074606e6ea800458cc03cdd6181c8020121bab30383039303930390023758606e002606e00260646ea808888dcc991919980080080224410022253330360021001132333004004303a0035333032302e371a00426e600044cdc500119b8a00537300026e64dd7181c0011b98001300100122533303000114bd7009981898171819000998010011819800a49034c5250003014302d375405044646600200200644a66606200229404c94ccc0b4cdc79bae303400200414a226600600600260680024a666050604260566ea80044c0bcc0b0dd50008a998152481134e6f7420616e20696e6c696e6520646174756d00162223233014004230023010302f3754002a666052604a60586ea800448c090ccc040dd5980798171baa001375c602a605c6ea800cdd7180798171baa003123371090001998081bab300f302e37540026eb8c054c0b8dd50019bae300f302e37540064464a666050604860566ea80044c0bcc0b0dd50008a9981524917436f756c64206e6f742066696e642072656465656d6572001632323300100100322533302f00114c0103d87a80001323232533302d3375e00c60600062602a6606600297ae01330050050023030002303300230310013374a90011981680125eb8094ccc094c084c0a0dd5000899191919191919192999819181a80109924c60500062c6eb4c0cc004c0cc008c0c4004c0c4008dd7181780098178011bae302d001302937540022c44646600200200644a6660580022980103d87a80001323253330293375e6028605a6ea80080144c044cc0bc0092f5c02660080080026060004605c0026002002444a6660520042980103d87a800013232533302630220031300e3302c0024bd70099980280280099b8000348004c0b400cc0ac0088888888c8c8c94ccc0a8cc03124011e48617320746f2072656465656d206174206c6561737420746865206d696e00337126eb4c02cc0b8dd50050010a99981519806249124d617820707269636520657863656564656400337126eb4c054c0b8dd50029bad3015302e3754601c605c6ea801854ccc0a8cc0312411b52656465656d696e67206d6f7265207468616e20616c6c6f77656400337120046eb4c02cc0b8dd50030a999815198062490d4e6f2073637269707420726566003375e6016605c6ea8021300103d87a800013300c49011757726f6e6720636f6e74696e75696e67206f75747075740033332222323300100133019005533302f302b30323754008264466ebcc070c0d4dd5180e181a9baa001002303630333754008264466ebcc070c0d4dd5000801181b18199baa00422533303500114a0264a66606264a66606466ebcc058c0d8dd5000803099299981c0008a5115333038303b001132323253330363371e6eb8c0f400d22100153330363371e00291010015333036303230393754980103d87a800015333036337129000001099b89002482026fb808528099b89480000085280a50375c6078607a0046eb4c0ecc0f0c0f0004dd6181d0008a503233001001323330010013756603260706ea800cc8cc004004020894ccc0ec00452f5bded8c02646607a66ec0dd49bae303a001374c64660020026eacc0f0008894ccc0f800452f5bded8c02646608066ec0dd49bae303d001375066e052000375a607c002660060066084004608000266006006607e004607a002444a6660760042002264666008008607e0066666604a0046eb8c0e8004dd5981d80091119299981d98140008a60103d87a80001302333041374c00297ae0323330010010030022225333042002100113233300400430460033333302d002375c60820026eb4c108004888c94ccc108c0f80045300103d87a80001302a33048375000297ae0337000040020546088004046607a00444a666072002297ae0132333222323300100100322533303f001100313233041374e660826ea4018cc104dd49bae303e0013304137506eb4c0fc0052f5c066006006608600460820026eb8c0e0004dd5981c80099801801981e801181d8008a50303800214a226600600600260700026606001097ae03374a900119818003a5eb80cdd2a400866060646460286606460660046606460660026606460666068002660646ea0cdc09bad300d3030375401000897ae03033001302e375400c97ae033330113333011330133756601e605c6ea8c03cc0b8dd5004a44100488100488100001375c601c605c6ea8028dd7180798171baa00600314a029405280a503370066e04ccc03cdd5980718169baa300e302d375401091010048810000153330293371200290000a400026eb4c050c0b4dd51808998179ba83370666e08dd6980a18169baa3300c30113302f375000297ae00034820225e8dd6980a18169baa30113302f375066e0920c8014820225e92f5c097ae0375a602660586ea8cc02cc040cc0b8dd4000a5eb8000ccdc09998069bab300c302b375400a6eb8c02cc0acdd50039bae300c302b375400666601a6eacc030c0acdd5180618159baa006375c601660566ea801cdd7180618159baa003230273028302830280012253330203330200014a094454cc0880084004400488c01ccc094dd419b83337046eb4c028c08cdd50011bad300a30233754002904044bd25eb808c090c094c0940048c08cc090004888c94ccc078c060c084dd50008a400026eb4c094c088dd500099299980f180c18109baa00114c103d87a8000132330010013756604c60466ea8008894ccc094004530103d87a8000132323253330233371e00e6eb8c09800c4c02ccc0a4dd4000a5eb804cc014014008dd698130011814801181380099198008008021129998120008a6103d87a8000132323253330223371e00e6eb8c09400c4c028cc0a0dd3000a5eb804cc014014008dd59812801181400118130009111299980e980c8008802099999805802001991900119198008008011129998128008a4c264a66604c002293099192999811980f98131baa3300f375c604c60540086eb8c0980084cc014014cc0a400800454cc0952401326b65797320696e206173736f63696174697665206c697374206172656e277420696e20617363656e64696e67206f726465720016302a0023028001302800133023337606ea4008dd4000a5eb7bdb180888c94ccc084c038004530103d87a80001300933027374c00297ae03333300f001005004222325333024302000114c103d87a80001300c3302a375000297ae0337000020040180126e95200022323300100100322533302000114bd6f7b630099191919299980f99b8f0070021003133025337606ea4008dd3000998030030019bab3022003375c60400046048004604400244646600200200644a66603e002297ae013232533301c300500213302200233004004001133004004001302300230210012301d001225333016337200040022980103d8798000153330163371e0040022980103d87a800014c103d87b80002533301900114a2294088888c8cc004004018894ccc0780044cc07ccdd81ba9006374c00a97adef6c60132323232533301d300d3300700a002133023337606ea4028dd30048028a99980e99b8f00a002132533301e301a3021375400226604866ec0dd4805981298111baa001004100433300800a009001133023337606ea4008dd3000998030030019bab3020003375c603c0046044004604000244444646600200200c44a66603a00226603c66ec0dd48031ba80054bd6f7b630099191919299980e18061980380500109981119bb037520146ea002401454ccc070cdc7805001099299980e980c98101baa001133023337606ea402cc090c084dd5000802080219980400500480089981119bb037520046ea0004cc01801800cdd6980f8019bae301d0023021002301f001375e98103d879800030123754018602a60246ea800458c050c054008c04c004c03cdd50008a4c26cac600200c464a666014600c00226464a66602260280042930b1bad3012001300e37540042a6660146008002264646464646464646464a666032603800426464649318088019808002299980a1808180b9baa007132323232533301d30200021324994ccc060c050c06cdd500189919299980f98110010a4c2c6eb8c080004c070dd50018b0b1bad301e001301e002301c0013018375400e2c2c60340026034004603000260300046eb8c058004c058008c050004c050008dd6980900098071baa0021533300a30030011533300f300e37540042930b0a99980519b874801800454ccc03cc038dd50010a4c2c2c60186ea8004dc3a40086e1d20022533300630023009375400226464a66601a60200042930b1bad300e001300a37540022c6e1d20005734ae6d5ce2ab9d5573caae7d5d02ba15745',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const mkLrpValidator = (params: LRPParams): SpendingValidator => {
|
|
18
|
-
return {
|
|
19
|
-
type: lrpValidatorData.type,
|
|
20
|
-
script: applyParamsToScript(lrpValidatorData.cborHex, [
|
|
21
|
-
castLrpParams(params),
|
|
22
|
-
]),
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const mkLrpValidatorFromSP = (
|
|
27
|
-
params: LrpParamsSP,
|
|
28
|
-
): SpendingValidator => {
|
|
29
|
-
return {
|
|
30
|
-
type: lrpValidatorData.type,
|
|
31
|
-
script: applyParamsToScript(lrpValidatorData.cborHex, [
|
|
32
|
-
castLrpParams({
|
|
33
|
-
versionRecordToken: fromSystemParamsAsset(params.versionRecordToken),
|
|
34
|
-
iassetNft: fromSystemParamsAsset(params.iassetNft),
|
|
35
|
-
minRedemptionLovelacesAmt: BigInt(params.minRedemptionLovelacesAmt),
|
|
36
|
-
iassetPolicyId: params.iassetPolicyId.unCurrencySymbol,
|
|
37
|
-
}),
|
|
38
|
-
]),
|
|
39
|
-
};
|
|
40
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyParamsToScript,
|
|
3
|
-
ScriptType,
|
|
4
|
-
SpendingValidator,
|
|
5
|
-
} from '@lucid-evolution/lucid';
|
|
6
|
-
import {
|
|
7
|
-
castPollManagerParams,
|
|
8
|
-
PollManagerParams,
|
|
9
|
-
} from '../types/indigo/poll-manager';
|
|
10
|
-
import {
|
|
11
|
-
PollManagerParamsSP,
|
|
12
|
-
fromSystemParamsAsset,
|
|
13
|
-
} from '../types/system-params';
|
|
14
|
-
|
|
15
|
-
const pollManagerValidatorData = {
|
|
16
|
-
type: 'PlutusV2' as ScriptType,
|
|
17
|
-
description: 'Generated by Aiken',
|
|
18
|
-
cborHex:
|
|
19
|
-
'59166859166501000032323232323232322232323232322322533300b323232533300e300830103754002264a66601e601260226ea80344c8c8c8c8c8c8c8c8c8c94c8ccc068c054c070dd50090999191919191919191911919299981518168010991919299981698180010992999815181218161baa00113232533303030330021323232533302f3301f4911d496e76616c696420696e707574206265696e672076616c696461746564003375e042602e60646ea802854ccc0bccc07d2401225468652070726f706f73616c206578636565647320766f74696e6720706572696f64003322325333032302c30343754002264a66606664a666070606e0022a666068605c606c002294454ccc0d0c0bcc0d80045280b0b1baa301c303637546038606c6ea80104cdc4000801899b89001003375a6070606a6ea8004528180c981a1baa301a30343754004602060646ea808cdd6980898191baa0201533302f3301f49011c54686520706f6c6c206f757470757420697320696e636f7272656374003333300e3758602260646ea808cc074cc0d00252f5c0602c66068603a6606864603e6606a606c0026606a64a666062605860666ea80384c080cc0d8dd419b80375a603260686ea800400cc0e0c0d0dd5000898101981b181b981a1baa00133036375066e00dd6980d181a1baa0010034bd70180c98199baa021303730370013032375404097ae04bd701bab301830323754603060646ea8029300103d87980001533302f3301f4910e4d697865642076657273696f6e73003375e602e60646ea8c05cc0c8dd5180c18191baa007301d33034301a3032375405c97ae01533302f3301f49127546865207472616e73616374696f6e206d757374206265207369676e6564206279206f776e6572003232330010013758606e6070607060706070607060706070607060686ea8094894ccc0d8004528099299981999b8f375c607200400829444cc00c00c004c0e4004dd7180b98191baa0041533302f3301f4911a5573657220766f74656420666f7220706f6c6c206265666f72650033302f3300d002375a602e60646ea8081282511533302f3301f491124d757374206d696e74206e6f20746f6b656e003375e6e98c8cc004004dd5981b181b981b981b981b98199baa02422533303500114bd6f7b630099191919299981a980a801080189981d19bb037520046e98004cc01801800cdd5981b8019bae3035002303900230370014c0101a0001533302f3301f491245374616b696e67506f736974696f6e206d757374207570646174652070726f7065726c79003333300e3758602260646ea808cc074cc0d0c078cc0d0c074cc0d0c068c0c8dd501725eb80cc0d130103d87a80004bd7025eb80c058cc0d0c074cc0d0c8c07ccc0d4c0d8004cc0d4dd319912999819198080028010991980080080311299981c0008a5eb7bdb1804cc0e4c8c94ccc0d8cdc3800803099bb0375000200a20046eb4c0dc004c0e8004cc008008c0ec0044c8c8cc00400401c894ccc0e4004400c4cc0e8c0ec004cc008008c0f0004cc0dccdd81ba80020014bd6f7b6301bad301830333754042603e6606a6ea0008cc0d4c048c0ccdd5010a5eb80c0dcc0dc004c0c8dd500225eb812f5c06eacc060c0c8dd5180c18191baa0074c0103d87a800013301f4901275374616b696e6720506f736974696f6e206d75737420757365204c6f636b2072656465656d65720032323375e004980103d87e8000325333031302c001132325333037303a002149858dd7181c000981a1baa00215333031302b00115333035303437540042930b0a99981898168008a99981a981a1baa00214985854ccc0c4cdc3a400c00226464a66606e60740042930b1bad3038001303437540042a66606266e1d200800115333035303437540042930b0a99981899b874802800454ccc0d4c0d0dd50010a4c2c2a66606266e1d200c00115333035303437540042930b0b18191baa0013301c30173032375400e6eacc06cc0c8dd50118a5014a029405280a5014a02940528199119980a8011bae3018303337540026eb8c064c0ccdd50009bab301730313754602e60626ea8018c040c0c4dd501699192999817981498189baa001132323300100100422533303600114bd6f7b63009919299981a19b88005375a60746076606e6ea8c0dc0084cc0e4008cc0100100044cc010010004c0e8008c0e0004dd6981a98191baa00116301630313754602c60626ea8c03cc0c4dd50111bab301630303754004a666058604e605c6ea80044c8c8c8c8c8c94ccc0d8c0e40084c8c9265333033302e3035375400426464a66607260780042930b1bad303a001303637540042c6605e00646464a66606a6060606e6ea80044c8c8c8c94ccc0f4c10000852616375a607c002607c0046eb4c0f0004c0e0dd50008b181b8011bad303500116303700130370023756606a002606a0046eb8c0cc004c0bcdd50008b0b181880098169baa0011632533302a3026302c375400226060605a6ea800454cc0ad241134e6f7420616e20696e6c696e6520646174756d0016300b302c3754602460586ea800458c0b8004ccc028dd6180798151baa01b3010302a375404c98103d8798000300e30293754601e60526ea800458c0ac004ccc01cdd6180618139baa018300c3027375404698103d8798000225333024301f30263754646600200200644a666054002298103d87a80001323253330283370e6eb4c0a80080144c05ccc0b4dd399816981500119816981580125eb812f5c0266008008002605c00460580022944528111111980819805002a999813181098141baa00413223375e602060566ea8c040c0acdd5000801181618149baa00413223375e602060566ea8004008c0b0c0a4dd50021299981399baf3009302a3754002008264a666058002294454ccc0b0c0bc0044c8c8c94ccc0acc02cdd718188018a99981598058008a999815981318169baa0061533302b337129000001099b89002482026fb808528099b89480000085280a50375c606060620046eb4c0bcc0c0c0c0004dd618170008a503233001001323330010013756602460586ea800cc8cc004004018894ccc0bc00452f5bded8c02646606266ec0dd49bae302e001374c64660020026eacc0c0008894ccc0c800452f5bded8c02646606866ec0dd49bae3031001375066e052000375a606400266006006606c00460680026600600660660046062002444a66605e004200226466600800860660066644646600200200a44a66606800226606a66ec0dd48021ba60034bd6f7b630099191919299981a19baf3301a0080024c0103d8798000133039337606ea4020dd30038028a99981a19b8f008002132533303530303037375400226607466ec0dd4804981d981c1baa0010041004325333035533303900114a229405300103d87a8000130243303a374c00297ae032333001001008002222533303b0021001132333004004303f00333223233001001005225333040001133041337606ea4010dd4001a5eb7bdb1804c8c8c8c94ccc100cdd799813004001260103d8798000133045337606ea4020dd40038028a99982019b8f0080021325333041303c3043375400226608c66ec0dd4804982398221baa0010041004325333041303c00114c103d87a80001303033046375000297ae03370000e00226608a66ec0dd48011ba800133006006003375a60840066eb8c100008c110008c108004dd7181d0009bad303b001303d002133039337606ea4008dd3000998030030019bab3036003375c60680046070004606c0026eb8c0b8004dd5981780098188011129998168008a5eb804c8ccc888c8cc00400400c894ccc0cc004400c4c8cc0d4dd39981a9ba90063303537526eb8c0c8004cc0d4dd41bad30330014bd7019801801981b801181a8009bae302c0013756605a002660060066062004605e0022940dc7a441002302630273027302730273027302730270012302530263026001222323300500423002300b30253754002a666040603660446ea800448c06cccc018dd5980518121baa001375c601260486ea800cdd7180518121baa003123371090001998031bab300a302437540026eb8c024c090dd50019bae300a3024375400644646600200200644a666048002297ae01323253330223005002133027002330040040011330040040013028002302600122232533301f3019302137540022900009bad30253022375400264a66603e603260426ea80045300103d87a8000132330010013756604c60466ea8008894ccc094004530103d87a8000132323253330243371e00e6eb8c09800c4c04ccc0a4dd4000a5eb804cc014014008dd698130011814801181380099198008008021129998120008a6103d87a8000132323253330233371e00e6eb8c09400c4c048cc0a0dd3000a5eb804cc014014008dd598128011814001181300091299980e19b9000200114c0103d87980001533301c3371e0040022980103d87a800014c103d87b80003020301d375402426466446601a9213953686f756c642063616c6c206120506f6c6c4d616e6167657220696e7075742077697468204d657267655368617264732072656465656d6572003232533301f3375e004600c660486ea00112f5c02660126eb0c01cc088dd50099299981019baf004300830233754002266ebcc020c08cdd5180498119baa001300b30233754022294052819299980f980d00089919299981298140010a4c2c6eb4c098004c088dd50010a99980f980c80089919299981298140010a4c2c6eb4c098004c088dd50010a99980f980d80089919299981298140010a4c2c6eb4c098004c088dd50010b18101baa0013300a0013756601260406ea8044dd6981080098109811000980e9baa012374a90021180f8009180f180f80091191980080080191299980f0008a50132533301b3004302100214a2266006006002604200246038603a603a603a002460366038603860386038603860386038603860380024464a66602c602260306ea80044c070c064dd50008a9980ba48117436f756c64206e6f742066696e642072656465656d6572001632323300100100322533301c00114c0103d87a80001323232533301b3375e00c603a006260146604000297ae0133005005002301d0023020002301e00130033301a0024bd701ba548008dd2a400044a666024666024002941288a9980980108008800980a98091baa00d14a0602860226ea800458c04cc050008c048004c038dd50008a4c26cac64a666014600a00226464a66602060260042649319299980698040008a99980898081baa00214985854ccc034c01c00454ccc044c040dd50010a4c2c2c601c6ea800458c044004c034dd50010a99980518020008991919192999809180a80109924ca66601c601260206ea80044c8c8c8c94ccc058c0640084c9265333012300d3014375400626464a66603060360042930b1bae3019001301537540062c2c6eb4c05c004c05c008c054004c044dd50008b0b180980098098011bad3011001300d37540042c60166ea8004c8c8c8c8c8c8c94ccc038c0240044c8c94ccc050c05c0084c9265333010300b3012375400226464646464646464646464646464646464646464646464646464a66605c606200426464649318100099929998161813800899192999819181a80109924ca66605c605260606ea80044c8c8c8c94ccc0d8c0e40084c8c9263303000225333034302f303637540022646464646464a66607c60820042930b1bad303f001303f002375c607a002607a0046eb8c0ec004c0dcdd50008b18148018b1bac303700130370023035001303137540022c2c6066002605e6ea805454ccc0b0c09800454ccc0c0c0bcdd500a8a4c2c2c605a6ea8050c94ccc0acc0980044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc11cc1280084c8c8c8c8c8c8c8c8c8c8c926304200b304100c304000d303f00e303e00f303d010303c011303b012303a013303c0143039015163048001304800230460013046002304400130440023042001304200230400013040002303e001303e002303c001303c002303a001303a002303800130380023036001303600230340013034002375c6064002605c6ea805854ccc0acc0940044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc11cc1280084c8c8c8c8c8c8c8c8c8c8c926304200b304100c304000d303f00e303e00f303d010303c011303b012303a013303c014325333044303f00113232533304a304d002132498c0ec00458c12c004c11cdd500b0a999822181f000899192999825182680109924c60780022c6096002608e6ea805858c114dd500a8b1824000982400118230009823001182200098220011821000982100118200009820001181f000981f001181e000981e001181d000981d001181c000981c001181b000981b001181a000981a0011bae3032001302e375402c2a666056604e00226464a6660626068004264932999816981418179baa0011323232323232323232323232323232323232323253330453048002132498c0d802c58dd6982300098230011bad30440013044002375a608400260840046eb4c100004c100008dd6981f000981f001181e000981e0011bad303a001303a002375a607000260700046eb4c0d8004c0d8008dd6981a00098181baa00116163032001302e375402c2a66605666e1d200600113232533303130340021324994ccc0b4c0a0c0bcdd5000899191919299981a981c00109924c6605c00246464a666068605e606c6ea80044c8c94ccc0e8c0f400852616375c6076002606e6ea800458c0d8008dd7181a0008b1bab30360013036002375a606800260606ea80045858c0c8004c0b8dd500b0a99981599b87480200044c8c94ccc0c4c0d000852616375c6064002605c6ea805858c0b0dd500a8b1bad302f001302f002375a605a002605a0046eb4c0ac004c0ac008dd6981480098148011bad30270013027002375a604a002604a0046eb4c08c004c08c008dd698108009810801180f800980f801180e800980e801180d800980d8011bae30190013019002375a602e00260266ea80045858c054004c044dd50060a999807180400089919299980a180b80109924ca666020601660246ea80044c8c8c8c8c8c8c8c94ccc070c07c0084c8c9263010002300c00516301d001301d002375a60360026036004603200260320046eb4c05c004c04cdd50008b0b180a80098089baa00c16300f37540164a66601a6010601e6ea80044c8c8c8c94ccc054c06000852616375a602c002602c0046eb4c050004c040dd50008b12999806180398071baa0011323253330123015002149858dd6980980098079baa001162533300b3006300d375400226464a66602260280042649318028008b180900098071baa001162533300a3005300c3754002264646464a666024602a0042646493192999808180580089919299980b180c80109924c64a666026601c00226464a66603260380042649318070008b180d000980b1baa00215333013300d0011323232323232533301d3020002149858dd6980f000980f0011bad301c001301c002375a6034002602c6ea800858c050dd50008b180b80098099baa00315333010300a00115333014301337540062930b0b18089baa002300700316301300130130023011001300d37540022c4a666012600860166ea80044c8c8c8c94ccc044c05000852616375c602400260240046eb8c040004c030dd50008b1192999804980200089919299980798090010a4c2c6eb8c040004c030dd50010a999804980180089919299980798090010a4c2c6eb8c040004c030dd50010b18051baa001370e90011b8748000dc3a400844646600200200644a66601600229309919801801980780118019806800ab9a5738aae7555cf2ab9f5740ae855d11',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const mkPollManagerValidator = (
|
|
23
|
-
params: PollManagerParams,
|
|
24
|
-
): SpendingValidator => {
|
|
25
|
-
return {
|
|
26
|
-
type: pollManagerValidatorData.type,
|
|
27
|
-
script: applyParamsToScript(pollManagerValidatorData.cborHex, [
|
|
28
|
-
castPollManagerParams(params),
|
|
29
|
-
]),
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const mkPollManagerValidatorFromSP = (
|
|
34
|
-
params: PollManagerParamsSP,
|
|
35
|
-
): SpendingValidator => {
|
|
36
|
-
return {
|
|
37
|
-
type: pollManagerValidatorData.type,
|
|
38
|
-
script: applyParamsToScript(pollManagerValidatorData.cborHex, [
|
|
39
|
-
castPollManagerParams({
|
|
40
|
-
govNFT: fromSystemParamsAsset(params.govNFT),
|
|
41
|
-
pollToken: fromSystemParamsAsset(params.pollToken),
|
|
42
|
-
upgradeToken: fromSystemParamsAsset(params.upgradeToken),
|
|
43
|
-
indyAsset: fromSystemParamsAsset(params.indyAsset),
|
|
44
|
-
govExecuteValHash: params.govExecuteValHash,
|
|
45
|
-
pBiasTime: BigInt(params.pBiasTime),
|
|
46
|
-
shardValHash: params.shardsValHash,
|
|
47
|
-
treasuryValHash: params.treasuryValHash,
|
|
48
|
-
initialIndyDistribution: BigInt(params.initialIndyDistribution),
|
|
49
|
-
}),
|
|
50
|
-
]),
|
|
51
|
-
};
|
|
52
|
-
};
|
package/src/types/indigo/cdp.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Data, Datum } from '@lucid-evolution/lucid';
|
|
2
|
-
import { AssetClassSchema } from '../generic';
|
|
3
|
-
import { OnChainDecimalSchema } from '../on-chain-decimal';
|
|
4
|
-
import { OracleAssetNftSchema } from './price-oracle';
|
|
5
|
-
import { match, P } from 'ts-pattern';
|
|
6
|
-
|
|
7
|
-
export const CDPFeesSchema = Data.Enum([
|
|
8
|
-
Data.Object({
|
|
9
|
-
ActiveCDPInterestTracking: Data.Object({
|
|
10
|
-
lastSettled: Data.Integer(),
|
|
11
|
-
unitaryInterestSnapshot: Data.Integer(),
|
|
12
|
-
}),
|
|
13
|
-
}),
|
|
14
|
-
Data.Object({
|
|
15
|
-
FrozenCDPAccumulatedFees: Data.Object({
|
|
16
|
-
lovelacesTreasury: Data.Integer(),
|
|
17
|
-
lovelacesIndyStakers: Data.Integer(),
|
|
18
|
-
}),
|
|
19
|
-
}),
|
|
20
|
-
]);
|
|
21
|
-
|
|
22
|
-
export const CDPContentSchema = Data.Object({
|
|
23
|
-
cdpOwner: Data.Nullable(Data.Bytes()),
|
|
24
|
-
iasset: Data.Bytes(),
|
|
25
|
-
mintedAmt: Data.Integer(),
|
|
26
|
-
cdpFees: CDPFeesSchema,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const IAssetContentSchema = Data.Object({
|
|
30
|
-
/** Use the HEX encoding */
|
|
31
|
-
assetName: Data.Bytes(),
|
|
32
|
-
price: Data.Enum([
|
|
33
|
-
Data.Object({ Delisted: OnChainDecimalSchema }),
|
|
34
|
-
Data.Object({
|
|
35
|
-
Oracle: OracleAssetNftSchema,
|
|
36
|
-
}),
|
|
37
|
-
]),
|
|
38
|
-
interestOracleNft: AssetClassSchema,
|
|
39
|
-
redemptionRatio: OnChainDecimalSchema,
|
|
40
|
-
maintenanceRatio: OnChainDecimalSchema,
|
|
41
|
-
liquidationRatio: OnChainDecimalSchema,
|
|
42
|
-
debtMintingFeePercentage: OnChainDecimalSchema,
|
|
43
|
-
liquidationProcessingFeePercentage: OnChainDecimalSchema,
|
|
44
|
-
stabilityPoolWithdrawalFeePercentage: OnChainDecimalSchema,
|
|
45
|
-
redemptionReimbursementPercentage: OnChainDecimalSchema,
|
|
46
|
-
redemptionProcessingFeePercentage: OnChainDecimalSchema,
|
|
47
|
-
interestCollectorPortionPercentage: OnChainDecimalSchema,
|
|
48
|
-
firstIAsset: Data.Boolean(),
|
|
49
|
-
nextIAsset: Data.Nullable(Data.Bytes()),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
export const CDPDatumSchema = Data.Enum([
|
|
53
|
-
Data.Object({ CDP: Data.Object({ content: CDPContentSchema }) }),
|
|
54
|
-
Data.Object({ IAsset: Data.Object({ content: IAssetContentSchema }) }),
|
|
55
|
-
]);
|
|
56
|
-
|
|
57
|
-
export type CDPFees = Data.Static<typeof CDPFeesSchema>;
|
|
58
|
-
export type CDPDatum = Data.Static<typeof CDPDatumSchema>;
|
|
59
|
-
const CDPDatum = CDPDatumSchema as unknown as CDPDatum;
|
|
60
|
-
|
|
61
|
-
export type CDPContent = Data.Static<typeof CDPContentSchema>;
|
|
62
|
-
const CDPContent = CDPContentSchema as unknown as CDPContent;
|
|
63
|
-
export type IAssetContent = Data.Static<typeof IAssetContentSchema>;
|
|
64
|
-
const IAssetContent = IAssetContentSchema as unknown as IAssetContent;
|
|
65
|
-
|
|
66
|
-
export function parseCDPDatum(datum: Datum): CDPContent {
|
|
67
|
-
return match(Data.from<CDPDatum>(datum, CDPDatum))
|
|
68
|
-
.with({ CDP: { content: P.select() } }, (res) => res)
|
|
69
|
-
.otherwise(() => {
|
|
70
|
-
throw new Error('Expected an CDP datum.');
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function serialiseCDPDatum(cdpDatum: CDPContent): Datum {
|
|
75
|
-
return Data.to<CDPDatum>({ CDP: { content: cdpDatum } }, CDPDatum);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function parseIAssetDatum(datum: Datum): IAssetContent {
|
|
79
|
-
return match(Data.from<CDPDatum>(datum, CDPDatum))
|
|
80
|
-
.with({ IAsset: { content: P.select() } }, (res) => res)
|
|
81
|
-
.otherwise(() => {
|
|
82
|
-
throw new Error('Expected an IAsset datum.');
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function serialiseIAssetDatum(iassetDatum: IAssetContent): Datum {
|
|
87
|
-
return Data.to<CDPDatum>({ IAsset: { content: iassetDatum } }, CDPDatum);
|
|
88
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Data } from '@lucid-evolution/lucid';
|
|
2
|
-
import { AssetClassSchema } from '../generic';
|
|
3
|
-
|
|
4
|
-
const ExecuteParamsSchema = Data.Object({
|
|
5
|
-
govNFT: AssetClassSchema,
|
|
6
|
-
upgradeToken: AssetClassSchema,
|
|
7
|
-
iAssetToken: AssetClassSchema,
|
|
8
|
-
stabilityPoolToken: AssetClassSchema,
|
|
9
|
-
versionRecordToken: AssetClassSchema,
|
|
10
|
-
cdpValHash: Data.Bytes(),
|
|
11
|
-
sPoolValHash: Data.Bytes(),
|
|
12
|
-
versionRegistryValHash: Data.Bytes(),
|
|
13
|
-
treasuryValHash: Data.Bytes(),
|
|
14
|
-
indyAsset: AssetClassSchema,
|
|
15
|
-
});
|
|
16
|
-
export type ExecuteParams = Data.Static<typeof ExecuteParamsSchema>;
|
|
17
|
-
export const ExecuteParams = ExecuteParamsSchema as unknown as ExecuteParams;
|
|
18
|
-
|
|
19
|
-
export function castExecuteParams(params: ExecuteParams): Data {
|
|
20
|
-
return Data.castTo(params, ExecuteParams);
|
|
21
|
-
}
|
package/src/types/indigo/gov.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Data, Datum } from '@lucid-evolution/lucid';
|
|
2
|
-
import { AssetClassSchema } from '../generic';
|
|
3
|
-
import { OnChainDecimalSchema } from '../on-chain-decimal';
|
|
4
|
-
|
|
5
|
-
const GovDatumSchema = Data.Object({
|
|
6
|
-
currentProposal: Data.Integer(),
|
|
7
|
-
protocolParams: Data.Object({
|
|
8
|
-
proposalDeposit: Data.Integer(),
|
|
9
|
-
votingPeriod: Data.Integer(),
|
|
10
|
-
effectiveDelay: Data.Integer(),
|
|
11
|
-
expirationPeriod: Data.Integer(),
|
|
12
|
-
collateralFeePercentage: OnChainDecimalSchema,
|
|
13
|
-
proposingPeriod: Data.Integer(),
|
|
14
|
-
totalShards: Data.Integer(),
|
|
15
|
-
minimumQuorum: Data.Integer(),
|
|
16
|
-
maxTreasuryLovelaceSpend: Data.Integer(),
|
|
17
|
-
maxTreasuryIndySpend: Data.Integer(),
|
|
18
|
-
}),
|
|
19
|
-
currentVersion: Data.Integer(),
|
|
20
|
-
iassetsCount: Data.Integer(),
|
|
21
|
-
activeProposals: Data.Integer(),
|
|
22
|
-
treasuryIndyWithdrawnAmt: Data.Integer(),
|
|
23
|
-
});
|
|
24
|
-
export type GovDatum = Data.Static<typeof GovDatumSchema>;
|
|
25
|
-
const GovDatum = GovDatumSchema as unknown as GovDatum;
|
|
26
|
-
|
|
27
|
-
export function parseGovDatum(datum: Datum): GovDatum {
|
|
28
|
-
return Data.from<GovDatum>(datum, GovDatum);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function serialiseGovDatum(d: GovDatum): Datum {
|
|
32
|
-
return Data.to<GovDatum>(d, GovDatum);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const GovParamsSchema = Data.Object({
|
|
36
|
-
govNFT: AssetClassSchema,
|
|
37
|
-
pollToken: AssetClassSchema,
|
|
38
|
-
upgradeToken: AssetClassSchema,
|
|
39
|
-
indyAsset: AssetClassSchema,
|
|
40
|
-
versionRecordToken: AssetClassSchema,
|
|
41
|
-
pollManagerValHash: Data.Bytes(),
|
|
42
|
-
gBiasTime: Data.Integer(),
|
|
43
|
-
daoIdentityToken: AssetClassSchema,
|
|
44
|
-
iAssetAuthToken: AssetClassSchema,
|
|
45
|
-
});
|
|
46
|
-
export type GovParams = Data.Static<typeof GovParamsSchema>;
|
|
47
|
-
export const GovParams = GovParamsSchema as unknown as GovParams;
|
|
48
|
-
|
|
49
|
-
export function castGovParams(params: GovParams): Data {
|
|
50
|
-
return Data.castTo(params, GovParams);
|
|
51
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Data } from '@lucid-evolution/lucid';
|
|
2
|
-
import { AssetClassSchema } from '../generic';
|
|
3
|
-
|
|
4
|
-
const PollManagerParamsSchema = Data.Object({
|
|
5
|
-
govNFT: AssetClassSchema,
|
|
6
|
-
pollToken: AssetClassSchema,
|
|
7
|
-
upgradeToken: AssetClassSchema,
|
|
8
|
-
indyAsset: AssetClassSchema,
|
|
9
|
-
govExecuteValHash: Data.Bytes(),
|
|
10
|
-
pBiasTime: Data.Integer(),
|
|
11
|
-
shardValHash: Data.Bytes(),
|
|
12
|
-
treasuryValHash: Data.Bytes(),
|
|
13
|
-
initialIndyDistribution: Data.Integer(),
|
|
14
|
-
});
|
|
15
|
-
export type PollManagerParams = Data.Static<typeof PollManagerParamsSchema>;
|
|
16
|
-
export const PollManagerParams =
|
|
17
|
-
PollManagerParamsSchema as unknown as PollManagerParams;
|
|
18
|
-
|
|
19
|
-
export function castPollManagerParams(params: PollManagerParams): Data {
|
|
20
|
-
return Data.castTo(params, PollManagerParams);
|
|
21
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Data } from '@lucid-evolution/lucid';
|
|
2
|
-
import { AssetClassSchema } from '../generic';
|
|
3
|
-
|
|
4
|
-
const PollShardParamsSchema = Data.Object({
|
|
5
|
-
pollToken: AssetClassSchema,
|
|
6
|
-
stakingToken: AssetClassSchema,
|
|
7
|
-
indyAsset: AssetClassSchema,
|
|
8
|
-
stakingValHash: Data.Bytes(),
|
|
9
|
-
});
|
|
10
|
-
export type PollShardParams = Data.Static<typeof PollShardParamsSchema>;
|
|
11
|
-
export const PollShardParams =
|
|
12
|
-
PollShardParamsSchema as unknown as PollShardParams;
|
|
13
|
-
|
|
14
|
-
export function castPollShardParams(params: PollShardParams): Data {
|
|
15
|
-
return Data.castTo(params, PollShardParams);
|
|
16
|
-
}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { Data, Datum } from '@lucid-evolution/lucid';
|
|
2
|
-
import { match, P } from 'ts-pattern';
|
|
3
|
-
import {
|
|
4
|
-
AddressSchema,
|
|
5
|
-
AssetClassSchema,
|
|
6
|
-
OutputReferenceSchema,
|
|
7
|
-
} from '../generic';
|
|
8
|
-
|
|
9
|
-
export const SPIntegerSchema = Data.Object({
|
|
10
|
-
value: Data.Integer(),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export type SPInteger = Data.Static<typeof SPIntegerSchema>;
|
|
14
|
-
export const SPInteger = SPIntegerSchema as unknown as SPInteger;
|
|
15
|
-
|
|
16
|
-
const StabilityPoolSnapshotSchema = Data.Object({
|
|
17
|
-
productVal: SPIntegerSchema,
|
|
18
|
-
depositVal: SPIntegerSchema,
|
|
19
|
-
sumVal: SPIntegerSchema,
|
|
20
|
-
epoch: Data.Integer(),
|
|
21
|
-
scale: Data.Integer(),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export type StabilityPoolSnapshot = Data.Static<
|
|
25
|
-
typeof StabilityPoolSnapshotSchema
|
|
26
|
-
>;
|
|
27
|
-
export const StabilityPoolSnapshot =
|
|
28
|
-
StabilityPoolSnapshotSchema as unknown as StabilityPoolSnapshot;
|
|
29
|
-
|
|
30
|
-
export const EpochToScaleToSumSchema = Data.Map(
|
|
31
|
-
Data.Object({ epoch: Data.Integer(), scale: Data.Integer() }),
|
|
32
|
-
SPIntegerSchema,
|
|
33
|
-
{ minItems: 0 },
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export type EpochToScaleToSum = Data.Static<typeof EpochToScaleToSumSchema>;
|
|
37
|
-
export const EpochToScaleToSum =
|
|
38
|
-
EpochToScaleToSumSchema as unknown as EpochToScaleToSum;
|
|
39
|
-
|
|
40
|
-
export const StabilityPoolContentSchema = Data.Object({
|
|
41
|
-
asset: Data.Bytes(),
|
|
42
|
-
snapshot: StabilityPoolSnapshotSchema,
|
|
43
|
-
epochToScaleToSum: EpochToScaleToSumSchema,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export type StabilityPoolContent = Data.Static<
|
|
47
|
-
typeof StabilityPoolContentSchema
|
|
48
|
-
>;
|
|
49
|
-
export const StabilityPoolContent =
|
|
50
|
-
StabilityPoolContentSchema as unknown as StabilityPoolContent;
|
|
51
|
-
|
|
52
|
-
export const AccountActionSchema = Data.Enum([
|
|
53
|
-
Data.Literal('Create'),
|
|
54
|
-
Data.Object({
|
|
55
|
-
Adjust: Data.Object({
|
|
56
|
-
amount: Data.Integer(),
|
|
57
|
-
outputAddress: AddressSchema,
|
|
58
|
-
}),
|
|
59
|
-
}),
|
|
60
|
-
Data.Object({ Close: Data.Object({ outputAddress: AddressSchema }) }),
|
|
61
|
-
]);
|
|
62
|
-
|
|
63
|
-
export type AccountAction = Data.Static<typeof AccountActionSchema>;
|
|
64
|
-
export const AccountAction = AccountActionSchema as unknown as AccountAction;
|
|
65
|
-
|
|
66
|
-
export const AccountContentSchema = Data.Object({
|
|
67
|
-
owner: Data.Bytes(),
|
|
68
|
-
asset: Data.Bytes(),
|
|
69
|
-
snapshot: StabilityPoolSnapshotSchema,
|
|
70
|
-
request: Data.Nullable(AccountActionSchema),
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export type AccountContent = Data.Static<typeof AccountContentSchema>;
|
|
74
|
-
export const AccountContent = AccountContentSchema as unknown as AccountContent;
|
|
75
|
-
|
|
76
|
-
export const SnapshotEpochToScaleToSumContentSchema = Data.Object({
|
|
77
|
-
asset: Data.Bytes(),
|
|
78
|
-
snapshot: EpochToScaleToSumSchema,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export type SnapshotEpochToScaleToSumContent = Data.Static<
|
|
82
|
-
typeof SnapshotEpochToScaleToSumContentSchema
|
|
83
|
-
>;
|
|
84
|
-
export const SnapshotEpochToScaleToSumContent =
|
|
85
|
-
SnapshotEpochToScaleToSumContentSchema as unknown as SnapshotEpochToScaleToSumContent;
|
|
86
|
-
|
|
87
|
-
export const StabilityPoolDatumSchema = Data.Enum([
|
|
88
|
-
Data.Object({
|
|
89
|
-
StabilityPool: Data.Object({ content: StabilityPoolContentSchema }),
|
|
90
|
-
}),
|
|
91
|
-
Data.Object({ Account: Data.Object({ content: AccountContentSchema }) }),
|
|
92
|
-
Data.Object({
|
|
93
|
-
SnapshotEpochToScaleToSum: Data.Object({
|
|
94
|
-
content: SnapshotEpochToScaleToSumContentSchema,
|
|
95
|
-
}),
|
|
96
|
-
}),
|
|
97
|
-
]);
|
|
98
|
-
|
|
99
|
-
export type StabilityPoolDatum = Data.Static<typeof StabilityPoolDatumSchema>;
|
|
100
|
-
export const StabilityPoolDatum =
|
|
101
|
-
StabilityPoolDatumSchema as unknown as StabilityPoolDatum;
|
|
102
|
-
|
|
103
|
-
export const ActionReturnDatumSchema = Data.Enum([
|
|
104
|
-
Data.Object({
|
|
105
|
-
IndigoStabilityPoolAccountAdjustment: Data.Object({
|
|
106
|
-
spent_account: OutputReferenceSchema,
|
|
107
|
-
}),
|
|
108
|
-
}),
|
|
109
|
-
Data.Object({
|
|
110
|
-
IndigoStabilityPoolAccountClosure: Data.Object({
|
|
111
|
-
closed_account: OutputReferenceSchema,
|
|
112
|
-
}),
|
|
113
|
-
}),
|
|
114
|
-
]);
|
|
115
|
-
|
|
116
|
-
export type ActionReturnDatum = Data.Static<typeof ActionReturnDatumSchema>;
|
|
117
|
-
export const ActionReturnDatum =
|
|
118
|
-
ActionReturnDatumSchema as unknown as ActionReturnDatum;
|
|
119
|
-
|
|
120
|
-
export const StabilityPoolRedeemerSchema = Data.Enum([
|
|
121
|
-
Data.Object({ RequestAction: Data.Object({ action: AccountActionSchema }) }),
|
|
122
|
-
Data.Object({
|
|
123
|
-
ProcessRequest: Data.Object({ requestRef: OutputReferenceSchema }),
|
|
124
|
-
}),
|
|
125
|
-
Data.Object({ AnnulRequest: Data.Object({}) }),
|
|
126
|
-
Data.Object({ LiquidateCDP: Data.Object({}) }),
|
|
127
|
-
Data.Object({ RecordEpochToScaleToSum: Data.Object({}) }),
|
|
128
|
-
Data.Object({ UpgradeVersion: Data.Object({}) }),
|
|
129
|
-
]);
|
|
130
|
-
|
|
131
|
-
export type StabilityPoolRedeemer = Data.Static<
|
|
132
|
-
typeof StabilityPoolRedeemerSchema
|
|
133
|
-
>;
|
|
134
|
-
export const StabilityPoolRedeemer =
|
|
135
|
-
StabilityPoolRedeemerSchema as unknown as StabilityPoolRedeemer;
|
|
136
|
-
|
|
137
|
-
export function parseStabilityPoolDatum(datum: Datum): StabilityPoolContent {
|
|
138
|
-
return match(Data.from<StabilityPoolDatum>(datum, StabilityPoolDatum))
|
|
139
|
-
.with({ StabilityPool: { content: P.select() } }, (res) => res)
|
|
140
|
-
.otherwise(() => {
|
|
141
|
-
throw new Error('Expected a Stability Pool datum.');
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function parseAccountDatum(datum: Datum): AccountContent {
|
|
146
|
-
return match(Data.from<StabilityPoolDatum>(datum, StabilityPoolDatum))
|
|
147
|
-
.with({ Account: { content: P.select() } }, (res) => res)
|
|
148
|
-
.otherwise(() => {
|
|
149
|
-
throw new Error('Expected a StakingPosition datum.');
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function parseSnapshotEpochToScaleToSumDatum(
|
|
154
|
-
datum: Datum,
|
|
155
|
-
): SnapshotEpochToScaleToSumContent {
|
|
156
|
-
return match(Data.from<StabilityPoolDatum>(datum, StabilityPoolDatum))
|
|
157
|
-
.with({ SnapshotEpochToScaleToSum: { content: P.select() } }, (res) => res)
|
|
158
|
-
.otherwise(() => {
|
|
159
|
-
throw new Error('Expected a SnapshotEpochToScaleToSum datum.');
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export function serialiseStabilityPoolDatum(d: StabilityPoolDatum): Datum {
|
|
164
|
-
let cbor = Data.to<StabilityPoolDatum>(d, StabilityPoolDatum);
|
|
165
|
-
if ('StabilityPool' in d) {
|
|
166
|
-
if (cbor.includes('bf')) {
|
|
167
|
-
if (d.StabilityPool.content.epochToScaleToSum.size > 0) {
|
|
168
|
-
cbor = cbor.replace(
|
|
169
|
-
'bf',
|
|
170
|
-
'a' + d.StabilityPool.content.epochToScaleToSum.size,
|
|
171
|
-
);
|
|
172
|
-
cbor = cbor.replace('ffffff', 'ffff');
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return cbor;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function serialiseStabilityPoolRedeemer(
|
|
180
|
-
params: StabilityPoolRedeemer,
|
|
181
|
-
): string {
|
|
182
|
-
return Data.to<StabilityPoolRedeemer>(params, StabilityPoolRedeemer);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** SP Parameters */
|
|
186
|
-
const StabilityPoolParamsSchema = Data.Object({
|
|
187
|
-
assetSymbol: Data.Bytes(),
|
|
188
|
-
stabilityPoolToken: AssetClassSchema,
|
|
189
|
-
snapshotEpochToScaleToSumToken: AssetClassSchema,
|
|
190
|
-
accountToken: AssetClassSchema,
|
|
191
|
-
cdpToken: AssetClassSchema,
|
|
192
|
-
iAssetAuthToken: AssetClassSchema,
|
|
193
|
-
versionRecordToken: AssetClassSchema,
|
|
194
|
-
collectorValHash: Data.Bytes(),
|
|
195
|
-
govNFT: AssetClassSchema,
|
|
196
|
-
accountCreateFeeLovelaces: Data.Integer(),
|
|
197
|
-
accountAdjustmentFeeLovelaces: Data.Integer(),
|
|
198
|
-
requestCollateralLovelaces: Data.Integer(),
|
|
199
|
-
});
|
|
200
|
-
export type StabilityPoolParams = Data.Static<typeof StabilityPoolParamsSchema>;
|
|
201
|
-
export const StabilityPoolParams =
|
|
202
|
-
StabilityPoolParamsSchema as unknown as StabilityPoolParams;
|
|
203
|
-
|
|
204
|
-
export function castStabilityPoolParams(params: StabilityPoolParams): Data {
|
|
205
|
-
return Data.castTo(params, StabilityPoolParams);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/** SP Integer */
|
|
209
|
-
const spPrecision: bigint = 1000000000000000000n;
|
|
210
|
-
|
|
211
|
-
export function mkSPInteger(value: bigint): SPInteger {
|
|
212
|
-
return { value: value * spPrecision };
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export function fromSPInteger(value: SPInteger): bigint {
|
|
216
|
-
return value.value / spPrecision;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export function spAdd(a: SPInteger, b: SPInteger): SPInteger {
|
|
220
|
-
return { value: a.value + b.value };
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export function spSub(a: SPInteger, b: SPInteger): SPInteger {
|
|
224
|
-
return { value: a.value - b.value };
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export function spMul(a: SPInteger, b: SPInteger): SPInteger {
|
|
228
|
-
return { value: (a.value * b.value) / spPrecision };
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export function spDiv(a: SPInteger, b: SPInteger): SPInteger {
|
|
232
|
-
return { value: (a.value * spPrecision) / b.value };
|
|
233
|
-
}
|