@meshsdk/core 1.5.16 → 1.6.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/constants.d.ts +1 -1
- package/dist/common/contracts/evaluator.d.ts +1 -1
- package/dist/common/contracts/fetcher.d.ts +1 -1
- package/dist/common/contracts/signer.d.ts +1 -1
- package/dist/common/data/index.d.ts +2 -0
- package/dist/common/data/mesh.d.ts +8 -0
- package/dist/common/data/plutus.d.ts +72 -0
- package/dist/common/data/plutus.spec.d.ts +1 -0
- package/dist/common/helpers/index.d.ts +0 -2
- package/dist/common/helpers/readPlutusData.d.ts +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/utils/builder.d.ts +2 -2
- package/dist/common/utils/converter.d.ts +1 -1
- package/dist/common/utils/deserializer.d.ts +1 -1
- package/dist/common/utils/resolver.d.ts +1 -1
- package/dist/core/CIP1852.d.ts +2 -2
- package/dist/core/CIP1853.d.ts +1 -1
- package/dist/core/CIP1855.d.ts +1 -1
- package/dist/core/CIP2.d.ts +1 -1
- package/dist/core/CIP8.d.ts +1 -1
- package/dist/core/{CPS-009.d.ts → CPS0009.d.ts} +1 -1
- package/dist/core/CSL.d.ts +2 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/core.cjs +18 -8
- package/dist/core.js +19918 -3022
- package/dist/index.d.ts +6 -2
- package/dist/providers/blockfrost.provider.d.ts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/koios.provider.d.ts +1 -1
- package/dist/providers/maestro.provider.d.ts +1 -1
- package/dist/providers/ogmios.provider.d.ts +1 -1
- package/dist/providers/tango.provider.d.ts +1 -1
- package/dist/providers/yaci.provider.d.ts +32 -0
- package/dist/scripts/forge.script.d.ts +1 -1
- package/dist/serializer/index.d.ts +2 -0
- package/dist/serializer/serializer.d.ts +42 -0
- package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +6 -34
- package/dist/transaction/meshTxBuilder/type.d.ts +1 -1
- package/dist/transaction/transaction.service.d.ts +1 -1
- package/dist/{common/types → types}/Asset.d.ts +1 -0
- package/dist/{common/types → types}/Network.d.ts +1 -1
- package/dist/types/PlutusScript.d.ts +5 -0
- package/dist/wallet/app.service.d.ts +8 -1
- package/dist/wallet/browser.service.d.ts +144 -14
- package/dist/wallet/embedded.service.d.ts +1 -1
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/mesh.service.d.ts +188 -0
- package/dist/wallet/mina.service.d.ts +1 -1
- package/package.json +3 -5
- package/dist/common/helpers/readTransaction.d.ts +0 -2
- package/dist/common/types/PlutusScript.d.ts +0 -6
- /package/dist/{common/helpers/mergeSignatures.d.ts → serializer/signatures.d.ts} +0 -0
- /package/dist/{common/types → types}/Account.d.ts +0 -0
- /package/dist/{common/types → types}/AccountInfo.d.ts +0 -0
- /package/dist/{common/types → types}/Action.d.ts +0 -0
- /package/dist/{common/types → types}/AssetExtended.d.ts +0 -0
- /package/dist/{common/types → types}/AssetMetadata.d.ts +0 -0
- /package/dist/{common/types → types}/BlockInfo.d.ts +0 -0
- /package/dist/{common/types → types}/Data.d.ts +0 -0
- /package/dist/{common/types → types}/DataSignature.d.ts +0 -0
- /package/dist/{common/types → types}/Era.d.ts +0 -0
- /package/dist/{common/types → types}/Mint.d.ts +0 -0
- /package/dist/{common/types → types}/NativeScript.d.ts +0 -0
- /package/dist/{common/types → types}/PoolParams.d.ts +0 -0
- /package/dist/{common/types → types}/Protocol.d.ts +0 -0
- /package/dist/{common/types → types}/Recipient.d.ts +0 -0
- /package/dist/{common/types → types}/Relay.d.ts +0 -0
- /package/dist/{common/types → types}/Token.d.ts +0 -0
- /package/dist/{common/types → types}/TransactionInfo.d.ts +0 -0
- /package/dist/{common/types → types}/UTxO.d.ts +0 -0
- /package/dist/{common/types → types}/Wallet.d.ts +0 -0
- /package/dist/{common/types → types}/index.d.ts +0 -0
package/dist/core.cjs
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const mr=require("nanoid"),qr=require("@emurgo/cardano-serialization-lib-nodejs"),Vr=require("axios"),De=require("bip39"),Y=require("@emurgo/cardano-message-signing-nodejs"),Lr=s=>s&&typeof s=="object"&&"default"in s?s:{default:s};function Gr(s){if(s&&s.__esModule)return s;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const i=Gr(qr),Mt=Lr(Vr),Yr=["testnet","preview","preprod","mainnet"],Ar=s=>Yr.includes(s),Gt={mem:7e6,steps:3e9},gt={epoch:0,coinsPerUTxOSize:"4310",priceMem:.0577,priceStep:721e-7,minFeeA:44,minFeeB:155381,keyDeposit:"2000000",maxTxSize:16384,maxValSize:"5000",poolDeposit:"500000000",maxCollateralInputs:3,decentralisation:0,maxBlockSize:98304,collateralPercent:150,maxBlockHeaderSize:1100,minPoolCost:"340000000",maxTxExMem:"16000000",maxTxExSteps:"10000000000",maxBlockExMem:"80000000",maxBlockExSteps:"40000000000"},be=2147483648,vt={V1:i.Language.new_plutus_v1(),V2:i.Language.new_plutus_v2()},Bt=56,$r={CERT:i.RedeemerTag.new_cert(),MINT:i.RedeemerTag.new_mint(),REWARD:i.RedeemerTag.new_reward(),SPEND:i.RedeemerTag.new_spend()},me={testnet:["74","1598400","1595967616","432000"],preview:["183","15811222","1682467200","86400"],preprod:["65","26438400","1682121600","432000"],mainnet:["208","4492800","1596059091","432000"]},Ye={ALONZO:i.TxBuilderConstants.plutus_alonzo_cost_models(),BABBAGE:(()=>{const s=i.Costmdls.new(),e=i.CostModel.new();Object.values({"addInteger-cpu-arguments-intercept":205665,"addInteger-cpu-arguments-slope":812,"addInteger-memory-arguments-intercept":1,"addInteger-memory-arguments-slope":1,"appendByteString-cpu-arguments-intercept":1e3,"appendByteString-cpu-arguments-slope":571,"appendByteString-memory-arguments-intercept":0,"appendByteString-memory-arguments-slope":1,"appendString-cpu-arguments-intercept":1e3,"appendString-cpu-arguments-slope":24177,"appendString-memory-arguments-intercept":4,"appendString-memory-arguments-slope":1,"bData-cpu-arguments":1e3,"bData-memory-arguments":32,"blake2b_256-cpu-arguments-intercept":117366,"blake2b_256-cpu-arguments-slope":10475,"blake2b_256-memory-arguments":4,"cekApplyCost-exBudgetCPU":23e3,"cekApplyCost-exBudgetMemory":100,"cekBuiltinCost-exBudgetCPU":23e3,"cekBuiltinCost-exBudgetMemory":100,"cekConstCost-exBudgetCPU":23e3,"cekConstCost-exBudgetMemory":100,"cekDelayCost-exBudgetCPU":23e3,"cekDelayCost-exBudgetMemory":100,"cekForceCost-exBudgetCPU":23e3,"cekForceCost-exBudgetMemory":100,"cekLamCost-exBudgetCPU":23e3,"cekLamCost-exBudgetMemory":100,"cekStartupCost-exBudgetCPU":100,"cekStartupCost-exBudgetMemory":100,"cekVarCost-exBudgetCPU":23e3,"cekVarCost-exBudgetMemory":100,"chooseData-cpu-arguments":19537,"chooseData-memory-arguments":32,"chooseList-cpu-arguments":175354,"chooseList-memory-arguments":32,"chooseUnit-cpu-arguments":46417,"chooseUnit-memory-arguments":4,"consByteString-cpu-arguments-intercept":221973,"consByteString-cpu-arguments-slope":511,"consByteString-memory-arguments-intercept":0,"consByteString-memory-arguments-slope":1,"constrData-cpu-arguments":89141,"constrData-memory-arguments":32,"decodeUtf8-cpu-arguments-intercept":497525,"decodeUtf8-cpu-arguments-slope":14068,"decodeUtf8-memory-arguments-intercept":4,"decodeUtf8-memory-arguments-slope":2,"divideInteger-cpu-arguments-constant":196500,"divideInteger-cpu-arguments-model-arguments-intercept":453240,"divideInteger-cpu-arguments-model-arguments-slope":220,"divideInteger-memory-arguments-intercept":0,"divideInteger-memory-arguments-minimum":1,"divideInteger-memory-arguments-slope":1,"encodeUtf8-cpu-arguments-intercept":1e3,"encodeUtf8-cpu-arguments-slope":28662,"encodeUtf8-memory-arguments-intercept":4,"encodeUtf8-memory-arguments-slope":2,"equalsByteString-cpu-arguments-constant":245e3,"equalsByteString-cpu-arguments-intercept":216773,"equalsByteString-cpu-arguments-slope":62,"equalsByteString-memory-arguments":1,"equalsData-cpu-arguments-intercept":1060367,"equalsData-cpu-arguments-slope":12586,"equalsData-memory-arguments":1,"equalsInteger-cpu-arguments-intercept":208512,"equalsInteger-cpu-arguments-slope":421,"equalsInteger-memory-arguments":1,"equalsString-cpu-arguments-constant":187e3,"equalsString-cpu-arguments-intercept":1e3,"equalsString-cpu-arguments-slope":52998,"equalsString-memory-arguments":1,"fstPair-cpu-arguments":80436,"fstPair-memory-arguments":32,"headList-cpu-arguments":43249,"headList-memory-arguments":32,"iData-cpu-arguments":1e3,"iData-memory-arguments":32,"ifThenElse-cpu-arguments":80556,"ifThenElse-memory-arguments":1,"indexByteString-cpu-arguments":57667,"indexByteString-memory-arguments":4,"lengthOfByteString-cpu-arguments":1e3,"lengthOfByteString-memory-arguments":10,"lessThanByteString-cpu-arguments-intercept":197145,"lessThanByteString-cpu-arguments-slope":156,"lessThanByteString-memory-arguments":1,"lessThanEqualsByteString-cpu-arguments-intercept":197145,"lessThanEqualsByteString-cpu-arguments-slope":156,"lessThanEqualsByteString-memory-arguments":1,"lessThanEqualsInteger-cpu-arguments-intercept":204924,"lessThanEqualsInteger-cpu-arguments-slope":473,"lessThanEqualsInteger-memory-arguments":1,"lessThanInteger-cpu-arguments-intercept":208896,"lessThanInteger-cpu-arguments-slope":511,"lessThanInteger-memory-arguments":1,"listData-cpu-arguments":52467,"listData-memory-arguments":32,"mapData-cpu-arguments":64832,"mapData-memory-arguments":32,"mkCons-cpu-arguments":65493,"mkCons-memory-arguments":32,"mkNilData-cpu-arguments":22558,"mkNilData-memory-arguments":32,"mkNilPairData-cpu-arguments":16563,"mkNilPairData-memory-arguments":32,"mkPairData-cpu-arguments":76511,"mkPairData-memory-arguments":32,"modInteger-cpu-arguments-constant":196500,"modInteger-cpu-arguments-model-arguments-intercept":453240,"modInteger-cpu-arguments-model-arguments-slope":220,"modInteger-memory-arguments-intercept":0,"modInteger-memory-arguments-minimum":1,"modInteger-memory-arguments-slope":1,"multiplyInteger-cpu-arguments-intercept":69522,"multiplyInteger-cpu-arguments-slope":11687,"multiplyInteger-memory-arguments-intercept":0,"multiplyInteger-memory-arguments-slope":1,"nullList-cpu-arguments":60091,"nullList-memory-arguments":32,"quotientInteger-cpu-arguments-constant":196500,"quotientInteger-cpu-arguments-model-arguments-intercept":453240,"quotientInteger-cpu-arguments-model-arguments-slope":220,"quotientInteger-memory-arguments-intercept":0,"quotientInteger-memory-arguments-minimum":1,"quotientInteger-memory-arguments-slope":1,"remainderInteger-cpu-arguments-constant":196500,"remainderInteger-cpu-arguments-model-arguments-intercept":453240,"remainderInteger-cpu-arguments-model-arguments-slope":220,"remainderInteger-memory-arguments-intercept":0,"remainderInteger-memory-arguments-minimum":1,"remainderInteger-memory-arguments-slope":1,"sha2_256-cpu-arguments-intercept":806990,"sha2_256-cpu-arguments-slope":30482,"sha2_256-memory-arguments":4,"sha3_256-cpu-arguments-intercept":1927926,"sha3_256-cpu-arguments-slope":82523,"sha3_256-memory-arguments":4,"sliceByteString-cpu-arguments-intercept":265318,"sliceByteString-cpu-arguments-slope":0,"sliceByteString-memory-arguments-intercept":4,"sliceByteString-memory-arguments-slope":0,"sndPair-cpu-arguments":85931,"sndPair-memory-arguments":32,"subtractInteger-cpu-arguments-intercept":205665,"subtractInteger-cpu-arguments-slope":812,"subtractInteger-memory-arguments-intercept":1,"subtractInteger-memory-arguments-slope":1,"tailList-cpu-arguments":41182,"tailList-memory-arguments":32,"trace-cpu-arguments":212342,"trace-memory-arguments":32,"unBData-cpu-arguments":31220,"unBData-memory-arguments":32,"unConstrData-cpu-arguments":32696,"unConstrData-memory-arguments":32,"unIData-cpu-arguments":43357,"unIData-memory-arguments":32,"unListData-cpu-arguments":32247,"unListData-memory-arguments":32,"unMapData-cpu-arguments":38314,"unMapData-memory-arguments":32,"verifyEd25519Signature-cpu-arguments-intercept":57996947,"verifyEd25519Signature-cpu-arguments-slope":18975,"verifyEd25519Signature-memory-arguments":10}).forEach((r,n)=>e.set(n,i.Int.new_i32(r)));const t=i.CostModel.new();return Object.values({"addInteger-cpu-arguments-intercept":205665,"addInteger-cpu-arguments-slope":812,"addInteger-memory-arguments-intercept":1,"addInteger-memory-arguments-slope":1,"appendByteString-cpu-arguments-intercept":1e3,"appendByteString-cpu-arguments-slope":571,"appendByteString-memory-arguments-intercept":0,"appendByteString-memory-arguments-slope":1,"appendString-cpu-arguments-intercept":1e3,"appendString-cpu-arguments-slope":24177,"appendString-memory-arguments-intercept":4,"appendString-memory-arguments-slope":1,"bData-cpu-arguments":1e3,"bData-memory-arguments":32,"blake2b_256-cpu-arguments-intercept":117366,"blake2b_256-cpu-arguments-slope":10475,"blake2b_256-memory-arguments":4,"cekApplyCost-exBudgetCPU":23e3,"cekApplyCost-exBudgetMemory":100,"cekBuiltinCost-exBudgetCPU":23e3,"cekBuiltinCost-exBudgetMemory":100,"cekConstCost-exBudgetCPU":23e3,"cekConstCost-exBudgetMemory":100,"cekDelayCost-exBudgetCPU":23e3,"cekDelayCost-exBudgetMemory":100,"cekForceCost-exBudgetCPU":23e3,"cekForceCost-exBudgetMemory":100,"cekLamCost-exBudgetCPU":23e3,"cekLamCost-exBudgetMemory":100,"cekStartupCost-exBudgetCPU":100,"cekStartupCost-exBudgetMemory":100,"cekVarCost-exBudgetCPU":23e3,"cekVarCost-exBudgetMemory":100,"chooseData-cpu-arguments":19537,"chooseData-memory-arguments":32,"chooseList-cpu-arguments":175354,"chooseList-memory-arguments":32,"chooseUnit-cpu-arguments":46417,"chooseUnit-memory-arguments":4,"consByteString-cpu-arguments-intercept":221973,"consByteString-cpu-arguments-slope":511,"consByteString-memory-arguments-intercept":0,"consByteString-memory-arguments-slope":1,"constrData-cpu-arguments":89141,"constrData-memory-arguments":32,"decodeUtf8-cpu-arguments-intercept":497525,"decodeUtf8-cpu-arguments-slope":14068,"decodeUtf8-memory-arguments-intercept":4,"decodeUtf8-memory-arguments-slope":2,"divideInteger-cpu-arguments-constant":196500,"divideInteger-cpu-arguments-model-arguments-intercept":453240,"divideInteger-cpu-arguments-model-arguments-slope":220,"divideInteger-memory-arguments-intercept":0,"divideInteger-memory-arguments-minimum":1,"divideInteger-memory-arguments-slope":1,"encodeUtf8-cpu-arguments-intercept":1e3,"encodeUtf8-cpu-arguments-slope":28662,"encodeUtf8-memory-arguments-intercept":4,"encodeUtf8-memory-arguments-slope":2,"equalsByteString-cpu-arguments-constant":245e3,"equalsByteString-cpu-arguments-intercept":216773,"equalsByteString-cpu-arguments-slope":62,"equalsByteString-memory-arguments":1,"equalsData-cpu-arguments-intercept":1060367,"equalsData-cpu-arguments-slope":12586,"equalsData-memory-arguments":1,"equalsInteger-cpu-arguments-intercept":208512,"equalsInteger-cpu-arguments-slope":421,"equalsInteger-memory-arguments":1,"equalsString-cpu-arguments-constant":187e3,"equalsString-cpu-arguments-intercept":1e3,"equalsString-cpu-arguments-slope":52998,"equalsString-memory-arguments":1,"fstPair-cpu-arguments":80436,"fstPair-memory-arguments":32,"headList-cpu-arguments":43249,"headList-memory-arguments":32,"iData-cpu-arguments":1e3,"iData-memory-arguments":32,"ifThenElse-cpu-arguments":80556,"ifThenElse-memory-arguments":1,"indexByteString-cpu-arguments":57667,"indexByteString-memory-arguments":4,"lengthOfByteString-cpu-arguments":1e3,"lengthOfByteString-memory-arguments":10,"lessThanByteString-cpu-arguments-intercept":197145,"lessThanByteString-cpu-arguments-slope":156,"lessThanByteString-memory-arguments":1,"lessThanEqualsByteString-cpu-arguments-intercept":197145,"lessThanEqualsByteString-cpu-arguments-slope":156,"lessThanEqualsByteString-memory-arguments":1,"lessThanEqualsInteger-cpu-arguments-intercept":204924,"lessThanEqualsInteger-cpu-arguments-slope":473,"lessThanEqualsInteger-memory-arguments":1,"lessThanInteger-cpu-arguments-intercept":208896,"lessThanInteger-cpu-arguments-slope":511,"lessThanInteger-memory-arguments":1,"listData-cpu-arguments":52467,"listData-memory-arguments":32,"mapData-cpu-arguments":64832,"mapData-memory-arguments":32,"mkCons-cpu-arguments":65493,"mkCons-memory-arguments":32,"mkNilData-cpu-arguments":22558,"mkNilData-memory-arguments":32,"mkNilPairData-cpu-arguments":16563,"mkNilPairData-memory-arguments":32,"mkPairData-cpu-arguments":76511,"mkPairData-memory-arguments":32,"modInteger-cpu-arguments-constant":196500,"modInteger-cpu-arguments-model-arguments-intercept":453240,"modInteger-cpu-arguments-model-arguments-slope":220,"modInteger-memory-arguments-intercept":0,"modInteger-memory-arguments-minimum":1,"modInteger-memory-arguments-slope":1,"multiplyInteger-cpu-arguments-intercept":69522,"multiplyInteger-cpu-arguments-slope":11687,"multiplyInteger-memory-arguments-intercept":0,"multiplyInteger-memory-arguments-slope":1,"nullList-cpu-arguments":60091,"nullList-memory-arguments":32,"quotientInteger-cpu-arguments-constant":196500,"quotientInteger-cpu-arguments-model-arguments-intercept":453240,"quotientInteger-cpu-arguments-model-arguments-slope":220,"quotientInteger-memory-arguments-intercept":0,"quotientInteger-memory-arguments-minimum":1,"quotientInteger-memory-arguments-slope":1,"remainderInteger-cpu-arguments-constant":196500,"remainderInteger-cpu-arguments-model-arguments-intercept":453240,"remainderInteger-cpu-arguments-model-arguments-slope":220,"remainderInteger-memory-arguments-intercept":0,"remainderInteger-memory-arguments-minimum":1,"remainderInteger-memory-arguments-slope":1,"serialiseData-cpu-arguments-intercept":1159724,"serialiseData-cpu-arguments-slope":392670,"serialiseData-memory-arguments-intercept":0,"serialiseData-memory-arguments-slope":2,"sha2_256-cpu-arguments-intercept":806990,"sha2_256-cpu-arguments-slope":30482,"sha2_256-memory-arguments":4,"sha3_256-cpu-arguments-intercept":1927926,"sha3_256-cpu-arguments-slope":82523,"sha3_256-memory-arguments":4,"sliceByteString-cpu-arguments-intercept":265318,"sliceByteString-cpu-arguments-slope":0,"sliceByteString-memory-arguments-intercept":4,"sliceByteString-memory-arguments-slope":0,"sndPair-cpu-arguments":85931,"sndPair-memory-arguments":32,"subtractInteger-cpu-arguments-intercept":205665,"subtractInteger-cpu-arguments-slope":812,"subtractInteger-memory-arguments-intercept":1,"subtractInteger-memory-arguments-slope":1,"tailList-cpu-arguments":41182,"tailList-memory-arguments":32,"trace-cpu-arguments":212342,"trace-memory-arguments":32,"unBData-cpu-arguments":31220,"unBData-memory-arguments":32,"unConstrData-cpu-arguments":32696,"unConstrData-memory-arguments":32,"unIData-cpu-arguments":43357,"unIData-memory-arguments":32,"unListData-cpu-arguments":32247,"unListData-memory-arguments":32,"unMapData-cpu-arguments":38314,"unMapData-memory-arguments":32,"verifyEcdsaSecp256k1Signature-cpu-arguments":35892428,"verifyEcdsaSecp256k1Signature-memory-arguments":10,"verifyEd25519Signature-cpu-arguments-intercept":57996947,"verifyEd25519Signature-cpu-arguments-slope":18975,"verifyEd25519Signature-memory-arguments":10,"verifySchnorrSecp256k1Signature-cpu-arguments-intercept":38887044,"verifySchnorrSecp256k1Signature-cpu-arguments-slope":32947,"verifySchnorrSecp256k1Signature-memory-arguments":10}).forEach((r,n)=>t.set(n,i.Int.new_i32(r))),s.insert(i.Language.new_plutus_v1(),e),s.insert(i.Language.new_plutus_v2(),t),s})()},zr={ALONZO:{V1:"a141005901d59f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f704001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff"},BABBAGE:{V1:"a141005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff",V2:"a20198af1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201b00000004a817c8001b00000004a817c8001a009063b91903fd0a1b00000004a817c800001b00000004a817c80041005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff"}},Me={[i.NetworkInfo.testnet().network_id()]:"8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3",[i.NetworkInfo.mainnet().network_id()]:"f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"},Wr={mainnet:"wss://ogmios-api.mainnet.dandelion.link",preprod:"wss://ogmios-api.iohk-preprod.dandelion.link",preview:"__TBD_SOON_TM__",testnet:"wss://ogmios-api.testnet.dandelion.link"},jr={LQ:"da8c30857834c6ae7203935b89278c532b3995245295456f993e1d244c51",MIN:"29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e",NTX:"edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458",iBTC:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069425443",iETH:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069455448",iUSD:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344",MILK:"8a1cfae21368b8bebbbed9800fec304e95cce39a2a57dc35e2e3ebaa4d494c4b",AGIX:"f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958",MELD:"6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44",INDY:"533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0494e4459",CLAY:"38ad9dc3aec6a2f38e220142b9aa6ade63ebe71f65e7cc2b7d8a8535434c4159",MCOS:"6f46e1304b16d884c85c62fb0eef35028facdc41aaa0fd319a152ed64d434f53",DING:"ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47",GERO:"10a49b996e2402269af553a8a96fb8eb90d79e9eca79e2b4223057b64745524f",NMKR:"5dac8536653edc12f6f5e1045d8164b9f59998d3bdc300fc928434894e4d4b52",PAVIA:"884892bcdc360bcef87d6b3f806e7f9cd5ac30d999d49970e7a903ae5041564941",HOSKY:"a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235484f534b59",YUMMI:"078eafce5cd7edafdf63900edef2c1ea759e77f30ca81d6bbdeec92479756d6d69",C3:"8e51398904a5d3fc129fbf4f1589701de23c7824d5c90fdb9490e15a434841524c4933",GIMBAL:"2b0a04a7b60132b1805b296c7fcb3b217ff14413991bf76f72663c3067696d62616c",SUNDAE:"9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d7753554e444145",GREENS:"4623ab311b7d982d8d26fcbe1a9439ca56661aafcdcd8d8a0ef31fd6475245454e53",GENS:"dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb0014df1047454e53",SOCIETY:"25f0fc240e91bd95dcdaebd2ba7713fc5168ac77234a3d79449fc20c534f4349455459",DJED:"8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344",SHEN:"8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd615368656e4d6963726f555344",WMT:"1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e776f726c646d6f62696c65746f6b656e",COPI:"b6a7467ea1deb012808ef4e87b5ff371e85f7142d7b356a40d9b42a0436f726e75636f70696173205b76696120436861696e506f72742e696f5d"},$e=["begin","eternl","flint","lace","nami","nufi","gerowallet","typhoncip30","vespr","yoroi"],pr=(s,e,t="5000000")=>{const r=i.BigNum.from_str(s.get("lovelace")??"0").checked_add(i.BigNum.from_str(t)),n=e.filter(l=>l.output.amount.filter(p=>p.unit!=="lovelace").some(p=>s.has(p.unit))),a=ts(n);return[...a.less_than(r)?es(r.clamped_sub(a).to_str(),e.filter(l=>!n.some(p=>p.input.txHash===l.input.txHash&&p.input.outputIndex===l.input.outputIndex))):[],...n]},Jr=(s,e,t=!1,{maxTxSize:r,minFeeA:n,minFeeB:a}=gt)=>{const c=e.filter(E=>_r(E)===!1).sort(Ke),l=i.BigNum.from_str(Ve(r,n,a)),p=t?i.BigNum.from_str(s).checked_add(l).to_str():s;return se(c,new Map([["lovelace",p]]))},Ir=(s,e,t=!1,r=gt)=>{const n=e.filter(_r).sort(Ke),a=Zr(r),c=s.get("lovelace")??"0",l=t?i.BigNum.from_str(c).checked_add(a).to_str():c;return s.set("lovelace",l),se(n,s)},Xr=(s,e)=>Array.from(e,t=>({unit:t[0],quantity:i.BigNum.from_str(t[1])})).every(t=>s.filter(r=>r.output.amount.find(n=>n.unit===t.unit)!==void 0).reduce((r,n)=>{const a=n.output.amount.reduce((c,l)=>c.checked_add(i.BigNum.from_str(t.unit===l.unit?l.quantity:"0")),i.BigNum.from_str("0"));return r.checked_add(a)},i.BigNum.from_str("0")).less_than(t.quantity)===!1),Ke=(s,e)=>{var n,a;const t=i.BigNum.from_str(((n=s.output.amount.find(c=>c.unit==="lovelace"))==null?void 0:n.quantity)??"0");return i.BigNum.from_str(((a=e.output.amount.find(c=>c.unit==="lovelace"))==null?void 0:a.quantity)??"0").compare(t)},Zr=s=>{const{maxTxSize:e,minFeeA:t,minFeeB:r}=s;return i.BigNum.from_str(Ve(e,t,r))},_r=s=>s.output.amount.length>1,ts=s=>s.reduce((e,t)=>{var n;const r=((n=t.output.amount.find(a=>a.unit==="lovelace"))==null?void 0:n.quantity)??"0";return e.checked_add(i.BigNum.from_str(r))},i.BigNum.from_str("0")),es=(s,e)=>{const t=e.sort(Ke);return se(t,new Map([["lovelace",s]]))},se=(s,e,t=[])=>s.length===0||Xr(t,e)?t:rs(s[0],e)?se(s.slice(1),e,[...t,s[0]]):se(s.slice(1),e,t),rs=(s,e)=>Array.from(e.keys()).some(t=>s.output.amount.find(r=>r.unit===t)!==void 0),ss=(s,e)=>{const t=as(e),r=os(s,e);return{coseKey:ht(t.to_bytes()),coseSign1:ht(r.to_bytes())}},ns=(s,e,{key:t,signature:r})=>{var c,l;const n=Y.COSEKey.from_bytes(G(t)),a=Y.COSESign1.from_bytes(G(r));if((s==null?void 0:s.length)>0){const p=ht(a.payload()??new Uint8Array);if(ct(s)!==p)return!1}if((e==null?void 0:e.length)>0){const A=(c=a.headers().protected().deserialized_headers().header(Y.Label.new_text("address")))==null?void 0:c.as_bytes();if(A===void 0)throw new Error("Couldn't find a signer address in signature");const C=(l=n.header(Y.Label.new_int(Y.Int.new_negative(Y.BigNum.from_str("2")))))==null?void 0:l.as_bytes();if(C===void 0)throw new Error("Couldn't find a signer key in signature");const E=Lt(ht(A)),w=Ns(ht(C));if(is(e,E,w)===!1)throw new Error("Couldn't check signature because of address mismatch");const b=Ts(ht(a.signature())),P=a.signed_data().to_bytes();return w.verify(P,b)}return!1},is=(s,e,t)=>{if(s!==e.to_bech32())return!1;try{return Yt(s)===t.hash().to_hex()}catch{return!1}},as=s=>{const e=Y.COSEKey.new(Y.Label.from_key_type(Y.KeyType.OKP));return e.set_algorithm_id(Y.Label.from_algorithm_id(Y.AlgorithmId.EdDSA)),e.set_header(Y.Label.new_int(Y.Int.new_negative(Y.BigNum.from_str("1"))),Y.CBORValue.new_int(Y.Int.new_i32(6))),e.set_header(Y.Label.new_int(Y.Int.new_negative(Y.BigNum.from_str("2"))),Y.CBORValue.new_bytes(s.key.to_public().as_bytes())),e},os=(s,e)=>{const t=Y.HeaderMap.new(),r=Y.HeaderMap.new();t.set_algorithm_id(Y.Label.from_algorithm_id(Y.AlgorithmId.EdDSA)),t.set_header(Y.Label.new_text("address"),Y.CBORValue.new_bytes(e.address.to_bytes()));const n=Y.Headers.new(Y.ProtectedHeaderMap.new(t),r),a=Y.COSESign1Builder.new(n,G(s.payload),!1);s.externalAAD!==void 0&&a.set_external_aad(G(s.externalAAD));const c=a.make_data_to_sign(),l=e.key.sign(c.to_bytes());return a.build(l.to_bytes())};var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yr={},ut={exports:{}};Dt.notEqual=us;Dt.notOk=ls;Dt.equal=cs;Dt.ok=Dt;var xr=Dt;function cs(s,e,t){Dt(s==e,t)}function us(s,e,t){Dt(s!=e,t)}function ls(s,e){Dt(!s,e)}function Dt(s,e){if(!s)throw new Error(e||"AssertionError")}var Et={exports:{}};function hs(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ds=He;He.supported=typeof WebAssembly<"u";function He(s){if(!He.supported)return null;var e=s&&s.imports,t=fs("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBx8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAZfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgHXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBF8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAWfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgE3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIICB8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAefHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgG3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB98fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAUfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgF3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBh8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCASfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBV8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAYfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgGnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBR8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiASfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB18fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAcfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggH3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBN8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAXfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgFnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBt8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAVfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggEXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFICB8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAZfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgGnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBF8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAWfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBN8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAVfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggG3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIICB8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAffHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBx8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAdfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggF3x8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBl8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAUfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgHnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBN8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAdfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgF3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBt8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByARfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBl8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAUfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgFXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB58fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAYfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFnx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIICB8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAffHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgEnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBp8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAdfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgFnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBJ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAgfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgH3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB58fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAVfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggG3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBF8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAYfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgF3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBR8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAafHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggE3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBl8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAcfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBx8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAYfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgH3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIB18fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByASfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggFHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBp8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAWfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHICB8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAVfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBd8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSATfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgG3x8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBd8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAgfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgH3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBp8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAcfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBF8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAZfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgHXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBN8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAefHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgGHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBJ8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAVfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgG3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBZ8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAbfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgE3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBl8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAVfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGHx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBd8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCASfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggFnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGICB8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAcfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgGnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB98fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAUfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB58fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSARfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgEXx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBJ8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiATfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgFHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBV8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAWfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggF3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBh8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAZfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgGnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBt8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAcfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB58fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAffHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgIHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB98fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAbfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBl8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAafHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgIHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIB58fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAXfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEnx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB18fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL"),r=null,n={buffer:t,memory:null,exports:null,realloc:a,onload:c};return c(function(){}),n;function a(p){n.exports.memory.grow(Math.ceil(Math.abs(p-n.memory.length)/65536)),n.memory=new Uint8Array(n.exports.memory.buffer)}function c(p){if(n.exports)return p();if(r){r.then(p.bind(null,null)).catch(p);return}try{if(s&&s.async)throw new Error("async");l({instance:new WebAssembly.Instance(new WebAssembly.Module(t),e)})}catch{r=WebAssembly.instantiate(t,e).then(l)}c(p)}function l(p){n.exports=p.instance.exports,n.memory=n.exports.memory&&n.exports.memory.buffer&&new Uint8Array(n.exports.memory.buffer)}}function fs(s){return typeof atob=="function"?new Uint8Array(atob(s).split("").map(gs)):new(hs("buffer")).Buffer(s,"base64")}function gs(s){return s.charCodeAt(0)}var xt=xr,j=ds(),bt=64,de=[];Et.exports=mt;var ze=Et.exports.BYTES_MIN=16,We=Et.exports.BYTES_MAX=64;Et.exports.BYTES=32;var je=Et.exports.KEYBYTES_MIN=16,Je=Et.exports.KEYBYTES_MAX=64;Et.exports.KEYBYTES=32;var Xe=Et.exports.SALTBYTES=16,Ze=Et.exports.PERSONALBYTES=16;function mt(s,e,t,r,n){if(!(this instanceof mt))return new mt(s,e,t,r,n);if(!(j&&j.exports))throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");s||(s=32),n!==!0&&(xt(s>=ze,"digestLength must be at least "+ze+", was given "+s),xt(s<=We,"digestLength must be at most "+We+", was given "+s),e!=null&&xt(e.length>=je,"key must be at least "+je+", was given "+e.length),e!=null&&xt(e.length<=Je,"key must be at least "+Je+", was given "+e.length),t!=null&&xt(t.length===Xe,"salt must be exactly "+Xe+", was given "+t.length),r!=null&&xt(r.length===Ze,"personal must be exactly "+Ze+", was given "+r.length)),de.length||(de.push(bt),bt+=216),this.digestLength=s,this.finalized=!1,this.pointer=de.pop(),j.memory.fill(0,0,64),j.memory[0]=this.digestLength,j.memory[1]=e?e.length:0,j.memory[2]=1,j.memory[3]=1,t&&j.memory.set(t,32),r&&j.memory.set(r,48),this.pointer+216>j.memory.length&&j.realloc(this.pointer+216),j.exports.blake2b_init(this.pointer,this.digestLength),e&&(this.update(e),j.memory.fill(0,bt,bt+e.length),j.memory[this.pointer+200]=128)}mt.prototype.update=function(s){return xt(this.finalized===!1,"Hash instance finalized"),xt(s,"input must be TypedArray or Buffer"),bt+s.length>j.memory.length&&j.realloc(bt+s.length),j.memory.set(s,bt),j.exports.blake2b_update(this.pointer,bt,bt+s.length),this};mt.prototype.digest=function(s){if(xt(this.finalized===!1,"Hash instance finalized"),this.finalized=!0,de.push(this.pointer),j.exports.blake2b_final(this.pointer),!s||s==="binary")return j.memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if(s==="hex")return As(j.memory,this.pointer+128,this.digestLength);xt(s.length>=this.digestLength,"input must be TypedArray or Buffer");for(var e=0;e<this.digestLength;e++)s[e]=j.memory[this.pointer+128+e];return s};mt.prototype.final=mt.prototype.digest;mt.WASM=j&&j.buffer;mt.SUPPORTED=typeof WebAssembly<"u";mt.ready=function(s){if(s||(s=ms),!j)return s(new Error("WebAssembly not supported"));var e=new Promise(function(t,r){j.onload(function(n){n?r():t(),s(n)})});return e};mt.prototype.ready=mt.ready;function ms(){}function As(s,e,t){for(var r="",n=0;n<t;n++)r+=ps(s[e+n]);return r}function ps(s){return s<16?"0"+s.toString(16):s.toString(16)}var Ut=xr,ne=Et.exports;function oe(s,e,t){var r=s[e]+s[t],n=s[e+1]+s[t+1];r>=4294967296&&n++,s[e]=r,s[e+1]=n}function tr(s,e,t,r){var n=s[e]+t;t<0&&(n+=4294967296);var a=s[e+1]+r;n>=4294967296&&a++,s[e]=n,s[e+1]=a}function wr(s,e){return s[e]^s[e+1]<<8^s[e+2]<<16^s[e+3]<<24}function Nt(s,e,t,r,n,a){var c=ee[n],l=ee[n+1],p=ee[a],A=ee[a+1];oe(H,s,e),tr(H,s,c,l);var C=H[r]^H[s],E=H[r+1]^H[s+1];H[r]=E,H[r+1]=C,oe(H,t,r),C=H[e]^H[t],E=H[e+1]^H[t+1],H[e]=C>>>24^E<<8,H[e+1]=E>>>24^C<<8,oe(H,s,e),tr(H,s,p,A),C=H[r]^H[s],E=H[r+1]^H[s+1],H[r]=C>>>16^E<<16,H[r+1]=E>>>16^C<<16,oe(H,t,r),C=H[e]^H[t],E=H[e+1]^H[t+1],H[e]=E>>>31^C<<1,H[e+1]=C>>>31^E<<1}var Cr=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Is=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],at=new Uint8Array(Is.map(function(s){return s*2})),H=new Uint32Array(32),ee=new Uint32Array(32);function Br(s,e){var t=0;for(t=0;t<16;t++)H[t]=s.h[t],H[t+16]=Cr[t];for(H[24]=H[24]^s.t,H[25]=H[25]^s.t/4294967296,e&&(H[28]=~H[28],H[29]=~H[29]),t=0;t<32;t++)ee[t]=wr(s.b,4*t);for(t=0;t<12;t++)Nt(0,8,16,24,at[t*16+0],at[t*16+1]),Nt(2,10,18,26,at[t*16+2],at[t*16+3]),Nt(4,12,20,28,at[t*16+4],at[t*16+5]),Nt(6,14,22,30,at[t*16+6],at[t*16+7]),Nt(0,10,20,30,at[t*16+8],at[t*16+9]),Nt(2,12,22,24,at[t*16+10],at[t*16+11]),Nt(4,14,16,26,at[t*16+12],at[t*16+13]),Nt(6,8,18,28,at[t*16+14],at[t*16+15]);for(t=0;t<16;t++)s.h[t]=s.h[t]^H[t]^H[t+16]}var Pt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function Wt(s,e,t,r){Pt.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=s,Pt[0]=s,e&&(Pt[1]=e.length),Pt[2]=1,Pt[3]=1,t&&Pt.set(t,32),r&&Pt.set(r,48);for(var n=0;n<16;n++)this.h[n]=Cr[n]^wr(Pt,n*4);e&&(Er(this,e),this.c=128)}Wt.prototype.update=function(s){return Ut(s!=null,"input must be Uint8Array or Buffer"),Er(this,s),this};Wt.prototype.digest=function(s){var e=!s||s==="binary"||s==="hex"?new Uint8Array(this.outlen):s;return Ut(e.length>=this.outlen,"out must have at least outlen bytes of space"),_s(this,e),s==="hex"?ys(e):e};Wt.prototype.final=Wt.prototype.digest;Wt.ready=function(s){ne.ready(function(){s()})};function Er(s,e){for(var t=0;t<e.length;t++)s.c===128&&(s.t+=s.c,Br(s,!1),s.c=0),s.b[s.c++]=e[t]}function _s(s,e){for(s.t+=s.c;s.c<128;)s.b[s.c++]=0;Br(s,!0);for(var t=0;t<s.outlen;t++)e[t]=s.h[t>>2]>>8*(t&3);return e}function ys(s){for(var e="",t=0;t<s.length;t++)e+=xs(s[t]);return e}function xs(s){return s<16?"0"+s.toString(16):s.toString(16)}var Sr=Wt;ut.exports=function(e,t,r,n,a){return a!==!0&&(Ut(e>=er,"outlen must be at least "+er+", was given "+e),Ut(e<=rr,"outlen must be at most "+rr+", was given "+e),t!=null&&Ut(t.length>=sr,"key must be at least "+sr+", was given "+t.length),t!=null&&Ut(t.length<=nr,"key must be at most "+nr+", was given "+t.length),r!=null&&Ut(r.length===ir,"salt must be exactly "+ir+", was given "+r.length),n!=null&&Ut(n.length===ar,"personal must be exactly "+ar+", was given "+n.length)),new Sr(e,t,r,n)};ut.exports.ready=function(s){ne.ready(function(){s()})};ut.exports.WASM_SUPPORTED=ne.SUPPORTED;ut.exports.WASM_LOADED=!1;var er=ut.exports.BYTES_MIN=16,rr=ut.exports.BYTES_MAX=64;ut.exports.BYTES=32;var sr=ut.exports.KEYBYTES_MIN=16,nr=ut.exports.KEYBYTES_MAX=64;ut.exports.KEYBYTES=32;var ir=ut.exports.SALTBYTES=16,ar=ut.exports.PERSONALBYTES=16;ne.ready(function(s){s||(ut.exports.WASM_LOADED=!0,Sr=ne)});var jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.bech32m=jt.bech32=void 0;const Ae="qpzry9x8gf2tvdw0s3jn54khce6mua7l",vr={};for(let s=0;s<Ae.length;s++){const e=Ae.charAt(s);vr[e]=s}function $t(s){const e=s>>25;return(s&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function or(s){let e=1;for(let t=0;t<s.length;++t){const r=s.charCodeAt(t);if(r<33||r>126)return"Invalid prefix ("+s+")";e=$t(e)^r>>5}e=$t(e);for(let t=0;t<s.length;++t){const r=s.charCodeAt(t);e=$t(e)^r&31}return e}function Fe(s,e,t,r){let n=0,a=0;const c=(1<<t)-1,l=[];for(let p=0;p<s.length;++p)for(n=n<<e|s[p],a+=e;a>=t;)a-=t,l.push(n>>a&c);if(r)a>0&&l.push(n<<t-a&c);else{if(a>=e)return"Excess padding";if(n<<t-a&c)return"Non-zero padding"}return l}function ws(s){return Fe(s,8,5,!0)}function Cs(s){const e=Fe(s,5,8,!1);if(Array.isArray(e))return e}function Bs(s){const e=Fe(s,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function br(s){let e;s==="bech32"?e=1:e=734539939;function t(c,l,p){if(p=p||90,c.length+7+l.length>p)throw new TypeError("Exceeds length limit");c=c.toLowerCase();let A=or(c);if(typeof A=="string")throw new Error(A);let C=c+"1";for(let E=0;E<l.length;++E){const w=l[E];if(w>>5!==0)throw new Error("Non 5-bit word");A=$t(A)^w,C+=Ae.charAt(w)}for(let E=0;E<6;++E)A=$t(A);A^=e;for(let E=0;E<6;++E){const w=A>>(5-E)*5&31;C+=Ae.charAt(w)}return C}function r(c,l){if(l=l||90,c.length<8)return c+" too short";if(c.length>l)return"Exceeds length limit";const p=c.toLowerCase(),A=c.toUpperCase();if(c!==p&&c!==A)return"Mixed-case string "+c;c=p;const C=c.lastIndexOf("1");if(C===-1)return"No separator character for "+c;if(C===0)return"Missing prefix for "+c;const E=c.slice(0,C),w=c.slice(C+1);if(w.length<6)return"Data too short";let b=or(E);if(typeof b=="string")return b;const P=[];for(let k=0;k<w.length;++k){const N=w.charAt(k),T=vr[N];if(T===void 0)return"Unknown character "+N;b=$t(b)^T,!(k+6>=w.length)&&P.push(T)}return b!==e?"Invalid checksum for "+c:{prefix:E,words:P}}function n(c,l){const p=r(c,l);if(typeof p=="object")return p}function a(c,l){const p=r(c,l);if(typeof p=="object")return p;throw new Error(p)}return{decodeUnsafe:n,decode:a,encode:t,toWords:ws,fromWordsUnsafe:Cs,fromWords:Bs}}jt.bech32=br("bech32");jt.bech32m=br("bech32m");var Es=ke&&ke.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(yr,"__esModule",{value:!0});const Ss=Es(ut.exports),ce=jt,Qe="asset";class re{constructor(e){this.hashBuf=e}static fromHash(e){return new re(e)}static fromParts(e,t){const r=(0,Ss.default)(20).update(new Uint8Array([...e,...t])).digest("binary");return re.fromHash(r)}static fromBech32(e){const{prefix:t,words:r}=ce.bech32.decode(e);if(t!==Qe)throw new Error("Invalid asset fingerprint");const n=Buffer.from(ce.bech32.fromWords(r));return re.fromHash(n)}fingerprint(){const e=ce.bech32.toWords(this.hashBuf);return ce.bech32.encode(Qe,e)}hash(){return Buffer.from(this.hashBuf).toString("hex")}prefix(){return Qe}checksum(){return this.fingerprint().slice(-6)}}var vs=yr.default=re;const bs=vs,Qs=(s,e)=>{const t=Ds(s),r=t.derive(be+1852).derive(be+1815).derive(be+e),n=r.derive(0).derive(0).to_raw_key(),a=r.derive(2).derive(0).to_raw_key();return r.free(),t.free(),{paymentKey:n,stakeKey:a}},Lt=s=>i.Address.from_bytes(G(s)),Ds=s=>i.Bip32PrivateKey.from_bytes(G(s)),ks=s=>i.DataHash.from_bytes(G(s)),Ct=s=>i.Ed25519KeyHash.from_bytes(G(s)),Ts=s=>i.Ed25519Signature.from_bytes(G(s)),_e=s=>i.NativeScript.from_bytes(G(s)),Ns=s=>i.PublicKey.from_bytes(G(s)),Qr=s=>i.PlutusData.from_bytes(G(s)),Jt=(s,e)=>i.PlutusScript.from_bytes_with_version(G(s),vt[e]),Ps=s=>i.ScriptRef.from_bytes(G(s)),Us=s=>i.ScriptHash.from_bytes(G(s)),It=s=>i.Transaction.from_bytes(G(s)),Dr=s=>i.TransactionHash.from_bytes(G(s)),cr=s=>i.TransactionUnspentOutput.from_bytes(G(s)),ur=s=>i.TransactionWitnessSet.from_bytes(G(s)),Os=s=>i.Value.from_bytes(G(s)),_t=s=>i.Address.from_bech32(s),Re=s=>i.BaseAddress.from_address(_t(s)),kr=s=>i.EnterpriseAddress.from_address(_t(s)),Tr=s=>i.RewardAddress.from_address(_t(s)),ht=s=>Buffer.from(s).toString("hex"),G=s=>s.length%2===0&&/^[0-9A-F]*$/i.test(s)?Buffer.from(s,"hex"):Buffer.from(s,"utf-8"),ye=s=>{const e=t=>{const r=new Array;for(let n=0;n<t.len();n+=1)r.push(ye(t.get(n)));return r};switch(s.kind()){case i.NativeScriptKind.ScriptAll:{const t=s.as_script_all();return{type:"all",scripts:e(t.native_scripts())}}case i.NativeScriptKind.ScriptAny:{const t=s.as_script_any();return{type:"any",scripts:e(t.native_scripts())}}case i.NativeScriptKind.ScriptNOfK:{const t=s.as_script_n_of_k();return{type:"atLeast",required:t.n(),scripts:e(t.native_scripts())}}case i.NativeScriptKind.TimelockStart:return{type:"after",slot:s.as_timelock_start().slot_bignum().to_str()};case i.NativeScriptKind.TimelockExpiry:return{type:"before",slot:s.as_timelock_expiry().slot_bignum().to_str()};case i.NativeScriptKind.ScriptPubkey:return{type:"sig",keyHash:s.as_script_pubkey().addr_keyhash().to_hex()};default:throw new Error(`Script Kind: ${s.kind()}, is not supported`)}},xe=s=>{const e=t=>{const r=i.NativeScripts.new();return t.forEach(n=>{r.add(xe(n))}),r};switch(s.type){case"all":return i.NativeScript.new_script_all(i.ScriptAll.new(e(s.scripts)));case"any":return i.NativeScript.new_script_any(i.ScriptAny.new(e(s.scripts)));case"atLeast":return i.NativeScript.new_script_n_of_k(i.ScriptNOfK.new(s.required,e(s.scripts)));case"after":return i.NativeScript.new_timelock_start(i.TimelockStart.new_timelockstart(i.BigNum.from_str(s.slot)));case"before":return i.NativeScript.new_timelock_expiry(i.TimelockExpiry.new_timelockexpiry(i.BigNum.from_str(s.slot)));case"sig":return i.NativeScript.new_script_pubkey(i.ScriptPubkey.new(Ct(s.keyHash)))}},fe=s=>{var r,n,a;const e=c=>{const l=[];for(let p=0;p<c.len();p+=1)l.push(fe(c.get(p)));return l},t=c=>{const l=new Map;for(let p=0;p<c.len();p+=1){const A=c.keys().get(p),C=c.get(A)??i.PlutusData.from_hex(ct("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));l.set(fe(A),fe(C))}return l};switch(s.kind()){case i.PlutusDataKind.Bytes:return ht(s.as_bytes()??new Uint8Array);case i.PlutusDataKind.Integer:return parseInt(((r=s.as_integer())==null?void 0:r.to_str())??"0",10);case i.PlutusDataKind.List:return e(s.as_list()??i.PlutusList.new());case i.PlutusDataKind.Map:return t(s.as_map()??i.PlutusMap.new());case i.PlutusDataKind.ConstrPlutusData:return{alternative:parseInt(((n=s.as_constr_plutus_data())==null?void 0:n.alternative().to_str())??"0",10),fields:e(((a=s.as_constr_plutus_data())==null?void 0:a.data())??i.PlutusList.new())};default:throw new Error(`PlutusData Kind: ${s.kind()}, is not supported`)}},Ot=s=>{const e=t=>{const r=i.PlutusList.new();return t.forEach(n=>{r.add(Ot(n))}),r};switch(typeof s){case"string":return i.PlutusData.new_bytes(G(s));case"number":return i.PlutusData.new_integer(i.BigInt.from_str(s.toString()));case"bigint":return i.PlutusData.new_integer(i.BigInt.from_str(s.toString()));case"object":if(s instanceof Array){const t=e(s);return i.PlutusData.new_list(t)}else if(s instanceof Map){const t=i.PlutusMap.new();return s.forEach((r,n)=>{t.insert(Ot(n),Ot(r))}),i.PlutusData.new_map(t)}else return i.PlutusData.new_constr_plutus_data(i.ConstrPlutusData.new(i.BigNum.from_str(s.alternative.toString()),e(s.fields)))}},Ms=s=>{const e=i.Relays.new();throw s.relays.forEach(t=>{e.add(Nr(t))}),new Error("toPoolParams not implemented.")},Te=s=>{const e=t=>$r[t];return i.Redeemer.new(e(s.tag),i.BigNum.from_str(s.index.toString()),Ot(s.data),i.ExUnits.new(i.BigNum.from_str(s.budget.mem.toString()),i.BigNum.from_str(s.budget.steps.toString())))},Nr=s=>{switch(s.type){case"SingleHostAddr":{const e=s.IPV4?i.Ipv4.new(new Uint8Array(s.IPV4.split(".").map(r=>parseInt(r)))):void 0,t=s.IPV6?i.Ipv6.new(G(s.IPV6.replaceAll(":",""))):void 0;return i.Relay.new_single_host_addr(i.SingleHostAddr.new(s.port,e,t))}case"SingleHostName":return i.Relay.new_single_host_name(i.SingleHostName.new(s.port,i.DNSRecordAorAAAA.new(s.domainName)));case"MultiHostName":return i.Relay.new_multi_host_name(i.MultiHostName.new(i.DNSRecordSRV.new(s.domainName)))}},Pr=s=>{if(s.is_plutus_script()){const t=s.plutus_script();return{code:t.to_hex(),version:Object.keys(vt).find(r=>vt[r].to_hex()===t.language_version().to_hex())}}const e=s.native_script();return ye(e)},Xt=s=>{if("code"in s){const e=Jt(s.code,s.version);return i.ScriptRef.new_plutus_script(e)}return i.ScriptRef.new_native_script(xe(s))},pe=s=>{var n,a,c;const e=s.output().has_data_hash()?(n=s.output().data_hash())==null?void 0:n.to_hex():void 0,t=s.output().has_plutus_data()?(a=s.output().plutus_data())==null?void 0:a.to_hex():void 0,r=s.output().has_script_ref()?(c=s.output().script_ref())==null?void 0:c.to_hex():void 0;return{input:{outputIndex:s.input().index(),txHash:s.input().transaction_id().to_hex()},output:{address:s.output().address().to_bech32(),amount:Ur(s.output().amount()),dataHash:e,plutusData:t,scriptRef:r}}},wt=s=>{const e=i.TransactionInput.new(Dr(s.input.txHash),s.input.outputIndex),t=i.TransactionOutput.new(_t(s.output.address),Qt(s.output.amount));return s.output.dataHash!==void 0&&t.set_data_hash(ks(s.output.dataHash)),s.output.plutusData!==void 0&&t.set_plutus_data(Qr(s.output.plutusData)),s.output.scriptRef!==void 0&&t.set_script_ref(Ps(s.output.scriptRef)),i.TransactionUnspentOutput.new(e,t)},lr=s=>{const e=s.split(".")[1]??"0",t=`${parseInt(e,10)}`,r="1"+"0".repeat(e.length);return i.UnitInterval.new(i.BigNum.from_str(t),i.BigNum.from_str(r))},ct=s=>s.length%2===0&&/^[0-9A-F]*$/i.test(s)?s:ht(Buffer.from(s,"utf-8")),qe=s=>Buffer.from(s,"hex").toString("utf-8"),Ur=s=>{const e=[{unit:"lovelace",quantity:s.coin().to_str()}],t=s.multiasset();if(t!==void 0){const r=t.keys();for(let n=0;n<r.len();n+=1){const a=r.get(n),c=t.get(a);if(c!==void 0){const l=c.keys();for(let p=0;p<l.len();p+=1){const A=l.get(p),C=c.get(A)??i.BigNum.from_str("0"),E=a.to_hex()+ht(A.name());e.push({unit:E,quantity:C.to_str()})}}}}return e},Qt=s=>{const e=s.find(a=>a.unit==="lovelace"),t=Array.from(new Set(s.filter(a=>a.unit!=="lovelace").map(a=>a.unit.slice(0,Bt)))),r=i.MultiAsset.new();t.forEach(a=>{const c=i.Assets.new();s.filter(l=>l.unit.slice(0,Bt)===a).forEach(l=>{c.insert(i.AssetName.new(G(l.unit.slice(Bt))),i.BigNum.from_str(l.quantity))}),r.insert(Us(a),c)});const n=i.Value.new(i.BigNum.from_str(e?e.quantity:"0"));return(s.length>1||!e)&&n.set_multiasset(r),n},hr=(s,e,t)=>i.BaseAddress.new(s,i.StakeCredential.from_keyhash(e),i.StakeCredential.from_keyhash(t)),Or=(s,e="")=>i.Bip32PrivateKey.from_bip39_entropy(G(s),G(ct(e))),Ne=s=>i.DataCost.new_coins_per_byte(i.BigNum.from_str(s)),Ks=s=>{if(typeof s!="object"||!("input"in s))return i.DatumSource.new(Ot(s));const e=wt(s);if(e.output().has_plutus_data())return i.DatumSource.new_ref_input(e.input());throw new Error(`No inline datum found in UTxO: ${e.input().transaction_id().to_hex()}`)},dr=(s,e)=>i.EnterpriseAddress.new(s,i.StakeCredential.from_keyhash(e)),fr=(s,e)=>{if(typeof s=="string")return i.MintWitness.new_native_script(_e(s));if(e===void 0)throw new Error("Minting with plutus requires a redeemer to be defined");if(e.tag!=="MINT")throw new Error("Minting redeemer's tag must be defined as 'MINT'");return i.MintWitness.new_plutus_script(Ue(s),Te({tag:"MINT",index:0,budget:Gt,data:{alternative:0,fields:[]},...e}))},Pe=(s,e)=>i.RewardAddress.new(s,i.StakeCredential.from_keyhash(e)),Ue=s=>{if("code"in s)return i.PlutusScriptSource.new(Jt(s.code,s.version));const e=wt(s);if(e.output().has_script_ref()){const t=e.output().script_ref();if(t.is_plutus_script()){const r=Pr(t),n=Jt(r.code,r.version).hash();return i.PlutusScriptSource.new_ref_input_with_lang_ver(n,e.input(),vt[r.version])}}throw new Error(`No plutus script reference found in UTxO: ${e.input().transaction_id().to_hex()}`)},ue=s=>{const e=i.ScriptPubkey.new(s);return i.NativeScript.new_script_pubkey(e)},ge=(s=gt)=>{const e=i.TransactionBuilderConfigBuilder.new().coins_per_utxo_byte(i.BigNum.from_str(s.coinsPerUTxOSize)).ex_unit_prices(i.ExUnitPrices.new(lr(s.priceMem.toString()),lr(s.priceStep.toString()))).fee_algo(i.LinearFee.new(i.BigNum.from_str(s.minFeeA.toString()),i.BigNum.from_str(s.minFeeB.toString()))).key_deposit(i.BigNum.from_str(s.keyDeposit)).max_tx_size(s.maxTxSize).max_value_size(parseInt(s.maxValSize,10)).pool_deposit(i.BigNum.from_str(s.poolDeposit)).build();return i.TransactionBuilder.new(e)},gr=s=>{const e=i.TxInputsBuilder.new();return s.map(t=>t instanceof i.TransactionUnspentOutput?t:wt(t)).forEach(t=>{e.add_input(t.output().address(),t.input(),t.output().amount())}),e},le=s=>{if(typeof s=="string")return i.TransactionOutputBuilder.new().with_address(_t(s));let e=i.TransactionOutputBuilder.new().with_address(_t(s.address));if(s.datum){const{value:t,inline:r}=s.datum,n=Ot(t);e=e.with_data_hash(i.hash_plutus_data(n)),r&&(e=e.with_plutus_data(n))}if(s.script){const t=Xt(s.script);e=e.with_script_ref(t)}return e},kt=s=>{const e=s.slice(0,Bt),t=s.includes(".")?ct(s.split(".")[1]):s.slice(Bt);return{policyId:e,assetName:t}},S=s=>Mt.default.isAxiosError(s)?s.response?JSON.stringify({data:s.response.data,headers:s.response.headers,status:s.response.status}):s.request?JSON.stringify(s.request):s.message:JSON.stringify(s),Hs=s=>{const e=Ot(s);return i.hash_plutus_data(e).to_hex()},Fs=(s,e=Date.now())=>{if(me[s]){const[t,r,n,a]=me[s];return parseInt(i.BigNum.from_str(e.toString()).div_floor(i.BigNum.from_str("1000")).checked_sub(i.BigNum.from_str(n)).div_floor(i.BigNum.from_str(a)).checked_add(i.BigNum.from_str(t)).to_str(),10)}throw new Error(`Couldn't resolve EpochNo for network: ${s}`)},Mr=(s,e)=>bs.fromParts(G(s),G(e)).fingerprint(),Rs=(s,e)=>zr[s][e],qs=s=>xe(s).hash().to_hex(),qt=s=>{var e,t;try{const r=[(e=Re(s))==null?void 0:e.payment_cred().to_keyhash(),(t=kr(s))==null?void 0:t.payment_cred().to_keyhash()].find(n=>n!==void 0);if(r!==void 0)return r.to_hex();throw new Error(`Couldn't resolve payment key hash from address: ${s}`)}catch(r){throw new Error(`An error occurred during resolvePaymentKeyHash: ${r}.`)}},Vs=(s,e=0)=>{const t=Jt(s.code,s.version);return i.EnterpriseAddress.new(e,i.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32()},Ls=s=>{try{const e=kr(s),t=e==null?void 0:e.payment_cred().to_scripthash();if(t!==void 0)return t.to_hex();throw new Error(`Couldn't resolve script hash from address: ${s}`)}catch(e){throw new Error(`An error occurred during resolveScriptHash: ${e}.`)}},Gs=s=>i.Ed25519KeyHash.from_hex(s).to_bech32("pool1"),Ys=s=>{const e=De.mnemonicToEntropy(s.join(" ")),t=Or(e),r=t.to_bech32();return t.free(),r},$s=s=>Xt(s).to_hex(),zs=(s,e=Date.now())=>{if(me[s]){const[t,r,n]=me[s];return i.BigNum.from_str(e.toString()).div_floor(i.BigNum.from_str("1000")).checked_sub(i.BigNum.from_str(n)).checked_add(i.BigNum.from_str(r)).to_str()}throw new Error(`Couldn't resolve SlotNo for network: ${s}`)},ie=s=>{try{const e=_t(s),t=Re(s),r=t==null?void 0:t.stake_cred().to_keyhash();if(r!==void 0)return Pe(e.network_id(),r).to_address().to_bech32();throw new Error(`Couldn't resolve reward address from address: ${s}`)}catch(e){throw new Error(`An error occurred during resolveRewardAddress: ${e}.`)}},Yt=s=>{var e,t;try{const r=[(e=Re(s))==null?void 0:e.stake_cred().to_keyhash(),(t=Tr(s))==null?void 0:t.payment_cred().to_keyhash()].find(n=>n!==void 0);if(r!==void 0)return r.to_hex();throw new Error(`Couldn't resolve stake key hash from address: ${s}`)}catch(r){throw new Error(`An error occurred during resolveStakeKeyHash: ${r}.`)}},Ve=(s,e=gt.minFeeA,t=gt.minFeeB)=>(BigInt(e)*BigInt(s)+BigInt(t)).toString(),Kr=s=>{const e=It(s).body();return i.hash_transaction(e).to_hex()},Ws=(s="",e=32)=>{if(e<=0||e>2048)throw new Error("Length must be bewteen 1 and 2048");const r=mr.customAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(e);return ct(`${s}${r}`)},Oe=(s,e)=>{const t=s.vkeys();if(t!==void 0){const r=new Set;for(let a=0;a<t.len();a+=1)r.add(t.get(a).to_hex());for(let a=0;a<e.len();a+=1)r.add(e.get(a).to_hex());const n=i.Vkeywitnesses.new();return r.forEach(a=>{n.add(i.Vkeywitness.from_hex(a))}),n}return e},js=s=>fe(Qr(s)),Js=s=>It(s).to_js_value();class Xs{_axiosInstance;constructor(...e){if(typeof e[0]=="string"&&e[0].startsWith("http"))this._axiosInstance=Mt.default.create({baseURL:e[0]});else{const t=e[0],r=t.slice(0,7);this._axiosInstance=Mt.default.create({baseURL:`https://cardano-${r}.blockfrost.io/api/v${e[1]??0}`,headers:{project_id:t}})}}async fetchAccountInfo(e){const t=e.startsWith("addr")?ie(e):e;try{const{data:r,status:n}=await this._axiosInstance.get(`accounts/${t}`);if(n===200)return{poolId:r.pool_id,active:r.active||r.active_epoch!==null,balance:r.controlled_amount,rewards:r.withdrawable_amount,withdrawals:r.withdrawals_sum};throw S(r)}catch(r){throw S(r)}}resolveScriptRef=async e=>{if(e){const{data:t,status:r}=await this._axiosInstance.get(`scripts/${e}`);if(r===200){const n=t.type.startsWith("plutus")?{code:await this.fetchPlutusScriptCBOR(e),version:t.type.replace("plutus","")}:await this.fetchNativeScriptJSON(e);return Xt(n).to_hex()}throw S(t)}};toUTxO=async(e,t)=>({input:{outputIndex:e.output_index,txHash:t},output:{address:e.address,amount:e.amount,dataHash:e.data_hash??void 0,plutusData:e.inline_datum??void 0,scriptRef:await this.resolveScriptRef(e.reference_script_hash),scriptHash:e.reference_script_hash}});async fetchAddressUTxOs(e,t){const r=t!==void 0?`/${t}`:"",n=`addresses/${e}/utxos`+r,a=async(c=1,l=[])=>{const{data:p,status:A}=await this._axiosInstance.get(`${n}?page=${c}`);if(A===200)return p.length>0?a(c+1,[...l,...await Promise.all(p.map(C=>this.toUTxO(C,C.tx_hash)))]):l;throw S(p)};try{return await a()}catch{return[]}}async fetchAssetAddresses(e){const t=async(r=1,n=[])=>{const{policyId:a,assetName:c}=kt(e),{data:l,status:p}=await this._axiosInstance.get(`assets/${a}${c}/addresses?page=${r}`);if(p===200)return l.length>0?t(r+1,[...n,...l]):n;throw S(l)};try{return await t()}catch{return[]}}async fetchAssetMetadata(e){try{const{policyId:t,assetName:r}=kt(e),{data:n,status:a}=await this._axiosInstance.get(`assets/${t}${r}`);if(a===200)return{...n.onchain_metadata};throw S(n)}catch(t){throw S(t)}}async fetchBlockInfo(e){try{const{data:t,status:r}=await this._axiosInstance.get(`blocks/${e}`);if(r===200)return{confirmations:t.confirmations,epoch:t.epoch,epochSlot:t.epoch_slot.toString(),fees:t.fees,hash:t.hash,nextBlock:t.next_block??"",operationalCertificate:t.op_cert,output:t.output??"0",previousBlock:t.previous_block,size:t.size,slot:t.slot.toString(),slotLeader:t.slot_leader??"",time:t.time,txCount:t.tx_count,VRFKey:t.block_vrf};throw S(t)}catch(t){throw S(t)}}async fetchCollectionAssets(e,t=1){try{const{data:r,status:n}=await this._axiosInstance.get(`assets/policy/${e}?page=${t}`);if(n===200)return{assets:r.map(a=>({unit:a.asset,quantity:a.quantity})),next:r.length===100?t+1:null};throw S(r)}catch{return{assets:[],next:null}}}async fetchHandleAddress(e){try{const t=ct(e.replace("$","")),{data:r,status:n}=await this._axiosInstance.get(`assets/${Me[1]}${t}/addresses`);if(n===200)return r[0].address;throw S(r)}catch(t){throw S(t)}}async fetchProtocolParameters(e=Number.NaN){try{const{data:t,status:r}=await this._axiosInstance.get(`epochs/${isNaN(e)?"latest":e}/parameters`);if(r===200)return{coinsPerUTxOSize:t.coins_per_utxo_word,collateralPercent:t.collateral_percent,decentralisation:t.decentralisation_param,epoch:t.epoch,keyDeposit:t.key_deposit,maxBlockExMem:t.max_block_ex_mem,maxBlockExSteps:t.max_block_ex_steps,maxBlockHeaderSize:t.max_block_header_size,maxBlockSize:t.max_block_size,maxCollateralInputs:t.max_collateral_inputs,maxTxExMem:t.max_tx_ex_mem,maxTxExSteps:t.max_tx_ex_steps,maxTxSize:t.max_tx_size,maxValSize:t.max_val_size,minFeeA:t.min_fee_a,minFeeB:t.min_fee_b,minPoolCost:t.min_pool_cost,poolDeposit:t.pool_deposit,priceMem:t.price_mem,priceStep:t.price_step};throw S(t)}catch(t){throw S(t)}}async fetchTxInfo(e){try{const{data:t,status:r}=await this._axiosInstance.get(`txs/${e}`);if(r===200)return{block:t.block,deposit:t.deposit,fees:t.fees,hash:t.hash,index:t.index,invalidAfter:t.invalid_hereafter??"",invalidBefore:t.invalid_before??"",slot:t.slot.toString(),size:t.size};throw S(t)}catch(t){throw S(t)}}async fetchUTxOs(e){try{const{data:t,status:r}=await this._axiosInstance.get(`txs/${e}/utxos`);if(r===200){const n=t.outputs,a=[];return n.forEach(l=>{a.push(this.toUTxO(l,e))}),await Promise.all(a)}throw S(t)}catch(t){throw S(t)}}onTxConfirmed(e,t,r=100){let n=0;const a=setInterval(()=>{n>=r&&clearInterval(a),this.fetchTxInfo(e).then(c=>{this.fetchBlockInfo(c.block).then(l=>{(l==null?void 0:l.confirmations)>0&&(clearInterval(a),t())}).catch(()=>{n+=1})}).catch(()=>{n+=1})},5e3)}async submitTx(e){try{const t={"Content-Type":"application/cbor"},{data:r,status:n}=await this._axiosInstance.post("tx/submit",G(e),{headers:t});if(n===200)return r;throw S(r)}catch(t){throw S(t)}}async fetchPlutusScriptCBOR(e){const{data:t,status:r}=await this._axiosInstance.get(`scripts/${e}/cbor`);if(r===200)return t.cbor;throw S(t)}async fetchNativeScriptJSON(e){const{data:t,status:r}=await this._axiosInstance.get(`scripts/${e}/json`);if(r===200)return t.json;throw S(t)}}class Zs{_axiosInstance;constructor(e,t,r){const n=r.host??"ipfs.infura.io",a=r.port??5001,c=r.version??0;this._axiosInstance=Mt.default.create({baseURL:`https://${n}:${a}/api/v${c}`,auth:{username:e,password:t}})}async uploadContent(e,t=!1){try{const r={"Content-Type":"multipart/form-data"},{data:n,status:a}=await this._axiosInstance.post(`add?recursive=${t}`,e,{headers:r});if(a===200)return n;throw S(n)}catch(r){throw S(r)}}}class tn{_axiosInstance;constructor(...e){typeof e[0]=="string"&&e[0].startsWith("http")?this._axiosInstance=Mt.default.create({baseURL:e[0],headers:{Authorization:`Bearer ${e[1]}`}}):this._axiosInstance=Mt.default.create({baseURL:`https://${e[0]}.koios.rest/api/v${e[2]??0}`,headers:{Authorization:`Bearer ${e[1]}`}})}async fetchAccountInfo(e){try{const t=e.startsWith("addr")?ie(e):e,{data:r,status:n}=await this._axiosInstance.post("account_info",{_stake_addresses:[t]});if(n===200)return{poolId:r[0].delegated_pool,active:r[0].status==="registered",balance:r[0].total_balance.toString(),rewards:r[0].rewards_available,withdrawals:r[0].withdrawals};throw S(r)}catch(t){throw S(t)}}async fetchAddressUTxOs(e,t){try{const{data:r,status:n}=await this._axiosInstance.post("address_info",{_addresses:[e]});if(n===200){const a=r.flatMap(c=>c.utxo_set).map(c=>this.toUTxO(c,e));return t!==void 0?a.filter(c=>c.output.amount.find(l=>l.unit===t)!==void 0):a}throw S(r)}catch{return[]}}async fetchAssetAddresses(e){try{const{policyId:t,assetName:r}=kt(e),{data:n,status:a}=await this._axiosInstance.get(`asset_address_list?_asset_policy=${t}&_asset_name=${r}`);if(a===200)return n.map(c=>({address:c.payment_address,quantity:c.quantity}));throw S(n)}catch(t){throw S(t)}}async fetchAssetMetadata(e){try{const{policyId:t,assetName:r}=kt(e),{data:n,status:a}=await this._axiosInstance.get(`asset_info?_asset_policy=${t}&_asset_name=${r}`);if(a===200)return{...n[0].minting_tx_metadata[721][t][qe(r)]};throw S(n)}catch(t){throw S(t)}}async fetchBlockInfo(e){try{const{data:t,status:r}=await this._axiosInstance.post("block_info",{_block_hashes:[e]});if(r===200)return{confirmations:t[0].num_confirmations,epoch:t[0].epoch_no,epochSlot:t[0].epoch_slot.toString(),fees:t[0].total_fees??"",hash:t[0].hash,nextBlock:t[0].child_hash??"",operationalCertificate:t[0].op_cert,output:t[0].total_output??"0",previousBlock:t[0].parent_hash,size:t[0].block_size,slot:t[0].abs_slot.toString(),slotLeader:t[0].pool??"",time:t[0].block_time,txCount:t[0].tx_count,VRFKey:t[0].vrf_key};throw S(t)}catch(t){throw S(t)}}async fetchCollectionAssets(e,t=0){try{const{data:r,status:n}=await this._axiosInstance.get(`asset_policy_info?_asset_policy=${e}&limit=100&offset=${t}`);if(n===200)return{assets:r.map(a=>({unit:`${e}${a.asset_name}`,quantity:a.total_supply})),next:r.length===100?t+100:null};throw S(r)}catch(r){throw S(r)}}async fetchHandleAddress(e){try{const t=ct(e.replace("$","")),{data:r,status:n}=await this._axiosInstance.get(`asset_address_list?_asset_policy=${Me[1]}&_asset_name=${t}`);if(n===200)return r[0].payment_address;throw S(r)}catch(t){throw S(t)}}async fetchProtocolParameters(e){try{const{data:t,status:r}=await this._axiosInstance.get(`epoch_params?_epoch_no=${e}`);if(r===200)return{coinsPerUTxOSize:t[0].coins_per_utxo_size,collateralPercent:t[0].collateral_percent,decentralisation:t[0].decentralisation,epoch:t[0].epoch_no,keyDeposit:t[0].key_deposit,maxBlockExMem:t[0].max_block_ex_mem.toString(),maxBlockExSteps:t[0].max_block_ex_steps.toString(),maxBlockHeaderSize:t[0].max_bh_size,maxBlockSize:t[0].max_block_size,maxCollateralInputs:t[0].max_collateral_inputs,maxTxExMem:t[0].max_tx_ex_mem.toString(),maxTxExSteps:t[0].max_tx_ex_steps.toString(),maxTxSize:t[0].max_tx_size,maxValSize:t[0].max_val_size.toString(),minFeeA:t[0].min_fee_a,minFeeB:t[0].min_fee_b,minPoolCost:t[0].min_pool_cost,poolDeposit:t[0].pool_deposit,priceMem:t[0].price_mem,priceStep:t[0].price_step};throw S(t)}catch(t){throw S(t)}}async fetchTxInfo(e){var t,r;try{const{data:n,status:a}=await this._axiosInstance.post("tx_info",{_tx_hashes:[e]});if(a===200)return{block:n[0].block_hash,deposit:n[0].deposit,fees:n[0].fee,hash:n[0].tx_hash,index:n[0].tx_block_index,invalidAfter:((t=n[0].invalid_after)==null?void 0:t.toString())??"",invalidBefore:((r=n[0].invalid_before)==null?void 0:r.toString())??"",slot:n[0].absolute_slot.toString(),size:n[0].tx_size};throw S(n)}catch(n){throw S(n)}}async fetchUTxOs(e){try{console.log("hi");const{data:t,status:r}=await this._axiosInstance.post("tx_info",{_tx_hashes:[e]});if(r===200)return console.log(t[0]),t[0].outputs.map(a=>this.toUTxO(a,a.payment_addr.bech32));throw S(t)}catch(t){throw S(t)}}onTxConfirmed(e,t,r=100){let n=0;const a=setInterval(()=>{n>=r&&clearInterval(a),this.fetchTxInfo(e).then(c=>{this.fetchBlockInfo(c.block).then(l=>{(l==null?void 0:l.confirmations)>0&&(clearInterval(a),t())}).catch(()=>{n+=1})}).catch(()=>{n+=1})},5e3)}async submitTx(e){try{const t={"Content-Type":"application/cbor"},{data:r,status:n}=await this._axiosInstance.post("submittx",G(e),{headers:t});if(n===202)return r;throw S(r)}catch(t){throw S(t)}}toUTxO(e,t){var r,n;return{input:{outputIndex:e.tx_index,txHash:e.tx_hash},output:{address:t,amount:[{unit:"lovelace",quantity:e.value},...e.asset_list.map(a=>({unit:`${a.policy_id}${a.asset_name}`,quantity:`${a.quantity}`}))],dataHash:e.datum_hash??void 0,plutusData:((r=e.inline_datum)==null?void 0:r.bytes)??void 0,scriptRef:this.resolveScriptRef(e.reference_script),scriptHash:((n=e.reference_script)==null?void 0:n.hash)??void 0}}}resolveScriptRef=e=>{if(e){const t=e.type.startsWith("plutus")?{code:e.bytes,version:e.type.replace("plutus","")}:ye(_e(e.bytes));return Xt(t).to_hex()}}}class en{_baseUrl;constructor(...e){this._baseUrl=Ar(e[0])?Wr[e[0]]:e[0]}async evaluateTx(e){const t=await this.open();return this.send(t,"EvaluateTx",{evaluate:e}),new Promise((r,n)=>{t.addEventListener("message",a=>{try{const{result:c}=JSON.parse(a.data);c.EvaluationResult?r(Object.keys(c.EvaluationResult).map(l=>({index:parseInt(l.split(":")[1],10),tag:l.split(":")[0].toUpperCase(),budget:{mem:c.EvaluationResult[l].memory,steps:c.EvaluationResult[l].steps}}))):n(c.EvaluationFailure),t.close()}catch(c){n(c)}},{once:!0})})}async onNextTx(e){const t=await this.open();return this.send(t,"AwaitAcquire",{}),t.addEventListener("message",r=>{const{result:n}=JSON.parse(r.data);if(n===null)return this.send(t,"AwaitAcquire",{});n.AwaitAcquired===void 0&&e(n),this.send(t,"NextTx",{})}),()=>t.close()}async submitTx(e){const t=await this.open();return this.send(t,"SubmitTx",{submit:e}),new Promise((r,n)=>{t.addEventListener("message",a=>{try{const{result:c}=JSON.parse(a.data);c.SubmitSuccess?r(c.SubmitSuccess.txId):n(c.SubmitFail),t.close()}catch(c){n(c)}},{once:!0})})}async open(){const e=new WebSocket(this._baseUrl);return await new Promise(t=>{e.addEventListener("open",()=>t(!0),{once:!0})}),e}send(e,t,r){e.send(JSON.stringify({version:"1.0",type:"jsonwsp/request",servicename:"ogmios",methodname:t,args:r}))}}class rn{_axiosInstance;constructor(e,t,r,n=1){this._axiosInstance=Mt.default.create({baseURL:`https://cardano-${e}.tangocrypto.com/${t}/v${n}`,headers:{"x-api-key":r}})}async evaluateTx(e){try{const{data:t,status:r}=await this._axiosInstance.post("transactions/evaluate",{tx:e,utxos:[]});if(r===200)return t.redeemers.map(n=>({index:n.index,tag:n.purpose.toUpperCase(),budget:{mem:n.unit_mem,steps:n.unit_steps}}));throw S(t)}catch(t){throw S(t)}}async fetchAccountInfo(e){try{const t=e.startsWith("addr")?ie(e):e,{data:r,status:n}=await this._axiosInstance.get(`wallets/${t}`);if(n===200)return{poolId:r.pool_id,active:r.active,balance:r.controlled_total_stake,rewards:r.rewards_sum,withdrawals:r.withdrawals_sum};throw S(r)}catch(t){throw S(t)}}async fetchAddressUTxOs(e,t){const r=t!==void 0?`/assets/${t}`:"",n=`addresses/${e}${r}/utxos?size=50`,a=async(A="",C=[])=>{var b;const{data:E,status:w}=await this._axiosInstance.get(`${n}&cursor=${A}`);if(w===200)return E.cursor!==null&&((b=E.cursor)==null?void 0:b.length)>0?a(E.cursor,[...C,...E.data.map(p)]):E.data.map(p);throw S(E)},c=(A,C)=>{const E=[{unit:"lovelace",quantity:A.toString()}];return C.forEach(w=>{const b=ct(w.asset_name);E.push({unit:`${w.policy_id}${b}`,quantity:w.quantity.toString()})}),E},l=A=>{if(A){const C=A.type.startsWith("plutus")?{code:A.code,version:A.type.replace("plutus","")}:ye(_e(A.json));return Xt(C).to_hex()}},p=A=>{var C;return{input:{outputIndex:A.index,txHash:A.hash},output:{address:e,amount:c(A.value,A.assets),dataHash:void 0,plutusData:((C=A.inline_datum)==null?void 0:C.value_raw)??void 0,scriptRef:l(A.reference_script)}}};try{return await a()}catch{return[]}}async fetchAssetAddresses(e){const t=n=>({address:n.address,quantity:n.quantity.toString()}),r=async(n="",a=[])=>{var C;const{policyId:c,assetName:l}=kt(e),{data:p,status:A}=await this._axiosInstance.get(`assets/${c}${l}/addresses?size=100&cursor=${n}`);if(A===200)return p.cursor!==null&&((C=p.cursor)==null?void 0:C.length)>0?r(p.cursor,[...a,...p.data.map(t)]):p.data.map(t);throw S(p)};try{return await r()}catch{return[]}}async fetchAssetMetadata(e){var t;try{const{policyId:r,assetName:n}=kt(e),{data:a,status:c}=await this._axiosInstance.get(`assets/${r}${n}`);if(c===200)return{...(t=a.metadata.find(l=>l.label===721))==null?void 0:t.json[r][qe(n)]};throw S(a)}catch(r){throw S(r)}}async fetchBlockInfo(e){try{const{data:t,status:r}=await this._axiosInstance.get(`blocks/${e}`);if(r===200)return{confirmations:t.confirmations,epoch:t.epoch_no,epochSlot:t.epoch_slot_no.toString(),fees:t.fees.toString(),hash:t.hash,nextBlock:t.next_block.toString()??"",operationalCertificate:t.op_cert,output:t.out_sum.toString()??"0",previousBlock:t.previous_block.toString(),size:t.size,slot:t.slot_no.toString(),slotLeader:t.slot_leader??"",time:Date.parse(t.time),txCount:t.tx_count,VRFKey:t.vrf_key};throw S(t)}catch(t){throw S(t)}}async fetchCollectionAssets(e,t=""){try{const{data:r,status:n}=await this._axiosInstance.get(`policies/${e}/assets?size=100&cursor=${t}`);if(n===200)return{assets:r.data.map(a=>({unit:`${a.policy_id}${a.asset_name}`,quantity:a.quantity})),next:r.cursor};throw S(r)}catch{return{assets:[],next:null}}}async fetchHandleAddress(e){try{const t=ct(e.replace("$","")),{data:r,status:n}=await this._axiosInstance.get(`assets/${Me[1]}${t}/addresses`);if(n===200)return r.data[0].address;throw S(r)}catch(t){throw S(t)}}async fetchProtocolParameters(e){try{const{data:t,status:r}=await this._axiosInstance.get(`epochs/${e}/parameters`);if(r===200)return{coinsPerUTxOSize:t.coins_per_utxo_size.toString(),collateralPercent:t.collateral_percent,decentralisation:t.decentralisation,epoch:t.epoch_no,keyDeposit:t.key_deposit.toString(),maxBlockExMem:t.max_block_ex_mem.toString(),maxBlockExSteps:t.max_block_ex_steps.toString(),maxBlockHeaderSize:t.max_block_header_size,maxBlockSize:t.max_block_size,maxCollateralInputs:t.max_collateral_inputs,maxTxExMem:t.max_tx_ex_mem.toString(),maxTxExSteps:t.max_tx_ex_steps.toString(),maxTxSize:t.max_tx_size,maxValSize:t.max_val_size.toString(),minFeeA:t.min_fee_a,minFeeB:t.min_fee_b,minPoolCost:t.min_pool_cost.toString(),poolDeposit:t.pool_deposit.toString(),priceMem:t.price_mem,priceStep:t.price_step};throw S(t)}catch(t){throw S(t)}}async fetchTxInfo(e){try{const{data:t,status:r}=await this._axiosInstance.get(`transactions/${e}`);if(r===200)return{block:t.block.hash,deposit:t.deposit,fees:t.fee,hash:t.hash,index:t.block_index,invalidAfter:t.invalid_hereafter??"",invalidBefore:t.invalid_before??"",slot:t.block.slot_no.toString(),size:t.size};throw S(t)}catch(t){throw S(t)}}async fetchUTxOs(e){try{return console.log(e),[]}catch(t){throw S(t)}}onTxConfirmed(e,t,r=100){let n=0;const a=setInterval(()=>{n>=r&&clearInterval(a),this.fetchTxInfo(e).then(c=>{this.fetchBlockInfo(c.block).then(l=>{(l==null?void 0:l.confirmations)>0&&(clearInterval(a),t())}).catch(()=>{n+=1})}).catch(()=>{n+=1})},5e3)}async submitTx(e){try{const t={"Content-Type":"application/json"},{data:r,status:n}=await this._axiosInstance.post("transactions/submit",{tx:e},{headers:t});if(n===200)return r.tx_id;throw S(r)}catch(t){throw S(t)}}}class sn{_axiosInstance;_amountsAsStrings={headers:{"amounts-as-strings":"true"}};submitUrl;constructor({network:e,apiKey:t,turboSubmit:r=!1}){this._axiosInstance=Mt.default.create({baseURL:`https://${e}.gomaestro-api.org/v1`,headers:{"api-key":t}}),this.submitUrl=r?"txmanager/turbosubmit":"txmanager"}async evaluateTx(e){try{const{data:t,status:r}=await this._axiosInstance.post("transactions/evaluate",{cbor:e});if(r===200){const n={spend:"SPEND",mint:"MINT",cert:"CERT",wdrl:"REWARD"};return t.map(c=>{const l=c.ex_units,p=c.redeemer_index,A=n[c.redeemer_tag];return{budget:l,index:p,tag:A}})}throw S(t)}catch(t){throw S(t)}}async fetchAccountInfo(e){const t=e.startsWith("addr")?ie(e):e;try{const{data:r,status:n}=await this._axiosInstance.get(`accounts/${t}`,this._amountsAsStrings);if(n===200){const a=r.data;return{poolId:a.delegated_pool,active:a.registered,balance:a.total_balance,rewards:a.rewards_available,withdrawals:a.total_withdrawn}}throw S(r)}catch(r){throw S(r)}}async fetchAddressUTxOs(e,t){const r=(()=>e.startsWith("addr_vkh")||e.startsWith("addr_shared_vkh")?`addresses/cred/${e}`:`addresses/${e}`)(),n=t?`&asset=${t}`:"",a=async(c=null,l=[])=>{const p=c===null?"":`&cursor=${c}`,{data:A,status:C}=await this._axiosInstance.get(`${r}/utxos?count=100${n}${p}`,this._amountsAsStrings);if(C===200){const w=A.data.map(this.toUTxO),b=[...l,...w],P=A.next_cursor;return P==null?b:a(P,b)}throw S(A)};try{return await a()}catch{return[]}}async fetchAssetAddresses(e){const{policyId:t,assetName:r}=kt(e),n=async(a=null,c=[])=>{const l=a===null?"":`&cursor=${a}`,{data:p,status:A}=await this._axiosInstance.get(`assets/${t}${r}/addresses?count=100${l}`,this._amountsAsStrings);if(A===200){const E=p.data.map(P=>({address:P.address,quantity:P.amount})),w=p.next_cursor,b=[...c,...E];return w==null?b:n(w,b)}throw S(p)};try{return await n()}catch{return[]}}async fetchAssetMetadata(e){try{const{policyId:t,assetName:r}=kt(e),{data:n,status:a}=await this._axiosInstance.get(`assets/${t}${r}`);if(a===200){const c=n.data;return{...c.asset_standards.cip25_metadata,...c.asset_standards.cip68_metadata}}throw S(n)}catch(t){throw S(t)}}async fetchBlockInfo(e){var t;try{const{data:r,status:n}=await this._axiosInstance.get(`blocks/${e}`,this._amountsAsStrings);if(n===200){const a=r.data;return{confirmations:a.confirmations,epoch:a.epoch,epochSlot:a.epoch_slot.toString(),fees:a.total_fees,hash:a.hash,nextBlock:a.next_block??"",operationalCertificate:(t=a.operational_certificate)==null?void 0:t.hot_vkey,output:a.total_output_lovelace??"0",previousBlock:a.previous_block,size:a.size,slot:a.absolute_slot.toString(),slotLeader:a.block_producer??"",time:Date.parse(a.timestamp)/1e3,txCount:a.tx_hashes.length,VRFKey:i.VRFVKey.from_hex(a.vrf_key).to_bech32("vrf_vk")}}throw S(r)}catch(r){throw S(r)}}async fetchCollectionAssets(e,t){try{const{data:r,status:n}=await this._axiosInstance.get(`policy/${e}/assets?count=100${t?`&cursor=${t}`:""}`);if(n===200)return{assets:r.data.map(c=>({unit:e+c.asset_name,quantity:c.total_supply})),next:r.next_cursor};throw S(r)}catch{return{assets:[],next:null}}}async fetchHandleAddress(e){try{const t=e.charAt(0)==="$"?e.substring(1):e,{data:r,status:n}=await this._axiosInstance.get(`ecosystem/adahandle/${t}`);if(n===200)return r.data;throw S(r)}catch(t){throw S(t)}}async fetchProtocolParameters(e=Number.NaN){if(!isNaN(e))throw new Error("Maestro only supports fetching Protocol parameters of the latest completed epoch.");const t=r=>{const n=r.indexOf("/");return parseInt(r.slice(0,n))/parseInt(r.slice(n+1))};try{const{data:r,status:n}=await this._axiosInstance.get("protocol-params");if(n===200){const a=r.data;try{const{data:c,status:l}=await this._axiosInstance.get("epochs/current");if(l===200){const p=c.data;return{coinsPerUTxOSize:a.coins_per_utxo_byte.toString(),collateralPercent:parseInt(a.collateral_percentage),decentralisation:0,epoch:parseInt(p.epoch_no),keyDeposit:a.stake_key_deposit.toString(),maxBlockExMem:a.max_execution_units_per_block.memory.toString(),maxBlockExSteps:a.max_execution_units_per_block.steps.toString(),maxBlockHeaderSize:parseInt(a.max_block_header_size),maxBlockSize:parseInt(a.max_block_body_size),maxCollateralInputs:parseInt(a.max_collateral_inputs),maxTxExMem:a.max_execution_units_per_transaction.memory.toString(),maxTxExSteps:a.max_execution_units_per_transaction.steps.toString(),maxTxSize:parseInt(a.max_tx_size),maxValSize:a.max_value_size.toString(),minFeeA:a.min_fee_coefficient,minFeeB:a.min_fee_constant,minPoolCost:a.min_pool_cost.toString(),poolDeposit:a.pool_deposit.toString(),priceMem:t(a.prices.memory),priceStep:t(a.prices.steps)}}throw S(c)}catch(c){throw S(c)}}throw S(r)}catch(r){throw S(r)}}async fetchTxInfo(e){try{const{data:t,status:r}=await this._axiosInstance.get(`transactions/${e}`);if(r===200){const n=t.data;return{block:n.block_hash,deposit:n.deposit.toString(),fees:n.fee.toString(),hash:n.tx_hash,index:n.block_tx_index,invalidAfter:n.invalid_hereafter??"",invalidBefore:n.invalid_before??"",slot:n.block_absolute_slot.toString(),size:n.size-1}}throw S(t)}catch(t){throw S(t)}}async fetchUTxOs(e){try{const{data:t,status:r}=await this._axiosInstance.get(`transactions/${e}`,this._amountsAsStrings);if(r===200)return t.data.outputs.map(this.toUTxO);throw S(t)}catch(t){throw S(t)}}onTxConfirmed(e,t,r=100){let n=0;const a=setInterval(()=>{n>=r&&clearInterval(a),this.fetchTxInfo(e).then(c=>{this.fetchBlockInfo(c.block).then(l=>{(l==null?void 0:l.confirmations)>0&&(clearInterval(a),t())}).catch(()=>{n+=1})}).catch(()=>{n+=1})},5e3)}async submitTx(e){try{const t={"Content-Type":"application/cbor"},{data:r,status:n}=await this._axiosInstance.post(this.submitUrl,G(e),{headers:t});if(n===202)return r;throw S(r)}catch(t){throw S(t)}}toUTxO=e=>{var t,r,n;return{input:{outputIndex:e.index,txHash:e.tx_hash},output:{address:e.address,amount:e.assets.map(a=>({unit:a.unit,quantity:a.amount})),dataHash:(t=e.datum)==null?void 0:t.hash,plutusData:(r=e.datum)==null?void 0:r.bytes,scriptRef:this.resolveScript(e),scriptHash:(n=e.reference_script)==null?void 0:n.hash}}};resolveScript=e=>{if(e.reference_script){const t=e.reference_script.type==="native"?e.reference_script.json:{code:e.reference_script.bytes,version:e.reference_script.type.replace("plutusv","V")};return Xt(t).to_hex()}else return}}class nn{static withOneSignature(e){const t=Ct(qt(e));return ue(t).to_hex()}static withAtLeastNSignatures(e,t){const r=i.NativeScripts.new();e.forEach(a=>{const c=Ct(qt(a));r.add(ue(c))});const n=i.ScriptNOfK.new(t,r);return i.NativeScript.new_script_any(n).to_hex()}static withAnySignature(e){const t=i.NativeScripts.new();e.forEach(n=>{const a=Ct(qt(n));t.add(ue(a))});const r=i.ScriptAny.new(t);return i.NativeScript.new_script_any(r).to_hex()}static withAllSignatures(e){const t=i.NativeScripts.new();e.forEach(n=>{const a=Ct(qt(n));t.add(ue(a))});const r=i.ScriptAll.new(t);return i.NativeScript.new_script_any(r).to_hex()}static fromNativeScript(e){return xe(e).to_hex()}}function Kt(s,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(s,e,t,r);else for(var l=s.length-1;l>=0;l--)(c=s[l])&&(a=(n<3?c(a):n>3?c(e,t,a):c(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}const an=s=>class extends s{__visits=[]},Vt=()=>function(s,e,t){const r=t.value;t.value=function(...n){const a=r.call(this,...n);return this.__visits&&this.__visits.push(e),a}};exports.Transaction=class{_changeAddress;_txOutputs=new Map;_recipients=new Map;_totalBurns=new Map;_totalMints=new Map;_era;_initiator;_mintBuilder;_protocolParameters;_txBuilder;_txCertificates;_txInputsBuilder;_txWithdrawals;constructor(e={}){this._era=e.era,this._initiator=e.initiator,this._mintBuilder=i.MintBuilder.new(),this._protocolParameters=e.parameters??gt,this._txBuilder=ge(e.parameters),this._txCertificates=i.Certificates.new(),this._txInputsBuilder=i.TxInputsBuilder.new(),this._txWithdrawals=i.Withdrawals.new()}static attachMetadata(e,t,r="BABBAGE"){var c;const n=It(e),a=n.auxiliary_data()??i.AuxiliaryData.new();if(a.set_metadata(i.GeneralTransactionMetadata.from_hex(t)),a.set_prefer_alonzo_format(r==="ALONZO"),i.hash_auxiliary_data(a).to_hex()!==((c=n.body().auxiliary_data_hash())==null?void 0:c.to_hex()))throw new Error("[Transaction] attachMetadata: The metadata hash does not match the auxiliary data hash.");return i.Transaction.new(n.body(),n.witness_set(),a).to_hex()}static deattachMetadata(e){const t=It(e);return i.Transaction.new(t.body(),t.witness_set(),void 0).to_hex()}static maskMetadata(e,t="BABBAGE"){var a;const r=It(e),n=(a=r.auxiliary_data())==null?void 0:a.metadata();if(n!==void 0){const c=i.GeneralTransactionMetadata.new();for(let p=0;p<n.len();p+=1){const A=n.keys().get(p),C=n.get(A);c.insert(A,i.TransactionMetadatum.from_hex("0".repeat(((C==null?void 0:C.to_hex())??"").length)))}const l=r.auxiliary_data();return l!==void 0&&(l.set_metadata(c),l.set_prefer_alonzo_format(t==="ALONZO")),i.Transaction.new(r.body(),r.witness_set(),l).to_hex()}return e}static readMetadata(e){var r,n;return((n=(r=It(e).auxiliary_data())==null?void 0:r.metadata())==null?void 0:n.to_hex())??""}static writeMetadata(e,t,r="BABBAGE"){const n=It(e),a=n.auxiliary_data()??i.AuxiliaryData.new();return a.set_metadata(i.GeneralTransactionMetadata.from_hex(t)),a.set_prefer_alonzo_format(r==="ALONZO"),i.Transaction.new(n.body(),n.witness_set(),a).to_hex()}get size(){return this._txBuilder.full_size()}async build(){try{return(this._mintBuilder.has_plutus_scripts()||this.notVisited("redeemValue")===!1)&&(await this.addRequiredSignersIfNeeded(),await this.addCollateralIfNeeded()),await this.forgeAssetsIfNeeded(),await this.addTxInputsAsNeeded(),await this.addChangeAddress(),this._txBuilder.build_tx().to_hex()}catch(e){throw new Error(`[Transaction] An error occurred during build: ${e}.`)}}burnAsset(e,t,r){const n=this._totalBurns.has(t.unit)?i.BigNum.from_str(this._totalBurns.get(t.unit)??"0").checked_add(i.BigNum.from_str(t.quantity)).to_str():t.quantity;return this._mintBuilder.add_asset(fr(e,r),i.AssetName.new(G(t.unit.slice(Bt))),i.Int.new_negative(i.BigNum.from_str(t.quantity))),this._totalBurns.set(t.unit,n),this}delegateStake(e,t){const r=i.Certificate.new_stake_delegation(i.StakeDelegation.new(i.StakeCredential.from_keyhash(Ct(Yt(e))),i.Ed25519KeyHash.from_bech32(t)));return this._txCertificates.add(r),this}deregisterStake(e){const t=i.Certificate.new_stake_deregistration(i.StakeDeregistration.new(i.StakeCredential.from_keyhash(Ct(Yt(e)))));return this._txCertificates.add(t),this}mintAsset(e,t,r){var A,C;const n=(E,w)=>{const b=typeof E=="string"?_e(E).hash().to_hex():a(E).hash().to_hex(),P=ct(w.assetName);return{unit:`${b}${P}`,quantity:w.assetQuantity}},a=E=>{if("code"in E)return Jt(E.code,E.version);const w=wt(E);if(w.output().has_script_ref()){const b=w.output().script_ref();if(b.is_plutus_script()){const P=Pr(b);return Jt(P.code,P.version)}}throw new Error(`[Transaction] No plutus script reference found in UTxO: ${w.input().transaction_id().to_hex()}`)},c=n(e,t),p=i.BigNum.from_str(((A=this._totalMints.get(c.unit))==null?void 0:A.assetQuantity)??"0").checked_add(i.BigNum.from_str(c.quantity));return this._mintBuilder.add_asset(fr(e,r),i.AssetName.new(G(ct(t.assetName))),i.Int.new(i.BigNum.from_str(c.quantity))),this._recipients.has(t.recipient)?(C=this._recipients.get(t.recipient))==null||C.push(c):this._recipients.set(t.recipient,[c]),this._totalMints.set(c.unit,{...t,assetQuantity:p.to_str()}),this}redeemValue(e){const t={tag:"SPEND",budget:Gt,index:this._txInputsBuilder.inputs().len(),data:{alternative:0,fields:[]},...e.redeemer},r=wt(e.value),n=e.datum?i.PlutusWitness.new_with_ref(Ue(e.script),Ks(e.datum),Te(t)):i.PlutusWitness.new_with_ref_without_datum(Ue(e.script),Te(t));return this._txInputsBuilder.add_plutus_script_input(n,r.input(),r.output().amount()),this}registerStake(e){const t=i.Certificate.new_stake_registration(i.StakeRegistration.new(i.StakeCredential.from_keyhash(Ct(Yt(e)))));return this._txCertificates.add(t),this}registerPool(e){const t=i.Certificate.new_pool_registration(i.PoolRegistration.new(Ms(e)));return this._txCertificates.add(t),this}retirePool(e,t){const r=i.Certificate.new_pool_retirement(i.PoolRetirement.new(i.Ed25519KeyHash.from_bech32(e),t));return this._txCertificates.add(r),this}sendAssets(e,t){const r=Qt(t),n=r.multiasset();if(r.is_zero()||n===void 0)return this;const a=le(e).next(),c=r.coin().is_zero()?a.with_asset_and_min_required_coin_by_utxo_cost(n,Ne(this._protocolParameters.coinsPerUTxOSize)).build():a.with_coin_and_asset(r.coin(),n).build();return t.forEach(l=>{this.setTxOutput(l)}),this._txBuilder.add_output(c),this}sendLovelace(e,t){const n=le(e).next().with_coin(i.BigNum.from_str(t)).build();return this.setTxOutput({unit:"lovelace",quantity:t}),this._txBuilder.add_output(n),this}sendToken(e,t,r){return this.sendAssets(e,[{quantity:r,unit:jr[t]}]),this}sendValue(e,t){const r=Qt(t.output.amount),a=le(e).next().with_value(r).build();return t.output.amount.forEach(c=>{this.setTxOutput(c)}),this._txBuilder.add_output(a),this}setChangeAddress(e){return this._changeAddress=_t(e),this}setCollateral(e){const t=gr(e);return this._txBuilder.set_collateral(t),this}setMetadata(e,t){return this._txBuilder.add_json_metadatum_with_schema(i.BigNum.from_str(e.toString()),JSON.stringify(t),i.MetadataJsonSchema.NoConversions),this}setRequiredSigners(e){return Array.from(new Set(e.map(r=>r.startsWith("addr")?qt(r):Yt(r)).map(r=>Ct(r)))).forEach(r=>{this._txBuilder.add_required_signer(r)}),this}setTimeToStart(e){return this._txBuilder.set_validity_start_interval_bignum(i.BigNum.from_str(e)),this}setTimeToExpire(e){return this._txBuilder.set_ttl_bignum(i.BigNum.from_str(e)),this}setTxInputs(e){return e.map(t=>wt(t)).forEach(t=>{this._txInputsBuilder.add_input(t.output().address(),t.input(),t.output().amount())}),this}setTxRefInputs(e){return e.map(t=>wt(t)).forEach(t=>{this._txBuilder.add_reference_input(t.input())}),this}withdrawRewards(e,t){const r=Tr(e);return r!==void 0&&this._txWithdrawals.insert(r,i.BigNum.from_str(t)),this}async addBurnInputsIfNeeded(){if(this._initiator&&this._totalBurns.size>0&&this.notVisited("setTxInputs")){const e=await this._initiator.getUsedUTxOs();Ir(this._totalBurns,e.map(r=>pe(r))).map(r=>wt(r)).forEach(r=>{this._txInputsBuilder.add_input(r.output().address(),r.input(),r.output().amount())})}}async addChangeAddress(){if(this._initiator&&this._changeAddress===void 0){const e=await this._initiator.getUsedAddress();this._txBuilder.add_change_if_needed(e)}else this._changeAddress!==void 0&&this._txBuilder.add_change_if_needed(this._changeAddress)}async addCollateralIfNeeded(){if(this._initiator&&this.notVisited("setCollateral")){const e=await this._initiator.getUsedCollateral();this._txBuilder.set_collateral(gr(e))}}async addRequiredSignersIfNeeded(){if(this._initiator&&this.notVisited("setRequiredSigners")){const e=await this._initiator.getUsedAddress(),t=qt(e.to_bech32());this._txBuilder.add_required_signer(Ct(t))}}async addTxInputsAsNeeded(){if(this.notVisited("setTxInputs")){const e=await this.filterAvailableUTxOs();pr(this._txOutputs,e.map(r=>pe(r))).map(r=>wt(r)).forEach(r=>{this._txInputsBuilder.add_input(r.output().address(),r.input(),r.output().amount())})}if(this._txBuilder.set_inputs(this._txInputsBuilder),(this._mintBuilder.has_native_scripts()||this._mintBuilder.has_plutus_scripts())&&this._txBuilder.set_mint_builder(this._mintBuilder),this._txCertificates.len()>0&&this._txBuilder.set_certs(this._txCertificates),this._txWithdrawals.len()>0&&this._txBuilder.set_withdrawals(this._txWithdrawals),this._txBuilder.get_mint_builder()||this.notVisited("redeemValue")===!1){const e=this._era!==void 0?Ye[this._era]:Ye.BABBAGE;this._txBuilder.calc_script_data_hash(e)}}async forgeAssetsIfNeeded(){const e=(t,r)=>{const n=t.data.assetName,a=t.data.metadata,c=t.unit.slice(0,Bt);if(t.data.label==="777")return a;if(r&&r[c]){const{[c]:l,...p}=r,A={[n]:a,...l};return{[c]:{...A},...p}}return r!==void 0?{[c]:{[n]:a},...r}:{[c]:{[n]:a}}};await this.addBurnInputsIfNeeded(),Array.from(this._totalMints,t=>({unit:t[0],data:t[1]})).reduce((t,r)=>t.set(r.data.label,e(r,t.get(r.data.label))),new Map).forEach((t,r)=>{this._txBuilder.add_json_metadatum(i.BigNum.from_str(r),JSON.stringify(t))}),this.addMintOutputs()}async filterAvailableUTxOs(e=[]){return this._initiator===void 0?[]:(await this._initiator.getUsedUTxOs()).filter(r=>e.find(n=>n.input.txHash===r.input().transaction_id().to_hex())===void 0)}addMintOutputs(){this._recipients.forEach((e,t)=>{const n=Qt(e).multiasset();if(n!==void 0){const c=le(t).next().with_asset_and_min_required_coin_by_utxo_cost(n,Ne(this._protocolParameters.coinsPerUTxOSize)).build();this._txBuilder.add_output(c)}})}notVisited(e){return this.__visits.includes(e)===!1}setTxOutput(e){const r=i.BigNum.from_str(this._txOutputs.get(e.unit)??"0").checked_add(i.BigNum.from_str(e.quantity)).to_str();this._txOutputs.set(e.unit,r)}};Kt([Vt()],exports.Transaction.prototype,"mintAsset",null);Kt([Vt()],exports.Transaction.prototype,"redeemValue",null);Kt([Vt()],exports.Transaction.prototype,"sendAssets",null);Kt([Vt()],exports.Transaction.prototype,"sendValue",null);Kt([Vt()],exports.Transaction.prototype,"setCollateral",null);Kt([Vt()],exports.Transaction.prototype,"setRequiredSigners",null);Kt([Vt()],exports.Transaction.prototype,"setTxInputs",null);exports.Transaction=Kt([an],exports.Transaction);const on=(s,e,t)=>{const r=new Map(e);r.set("lovelace",String(Number(r.get("lovelace"))+Number(t)));const n=new Map;for(let w=0;w<s.length;w++)n.set(w,s[w]);const a=new Set,c=new Set,l=new Set,p=new Set,A=new Set;for(let w=0;w<s.length;w++)switch(s[w].output.amount.length){case 1:{c.add(w);break}case 2:{l.add(w);break}case 3:{p.add(w);break}default:{A.add(w);break}}const C=(w,b,P)=>{const k=n.get(w);if(!k)return;const N=cn(k,b);if(Number(N)>0){a.add(w),P.delete(w);for(const T of k.output.amount)r.set(T.unit,String(Number(r.get(T.unit))-Number(T.quantity)))}};for(const w of r.keys())if(w!="lovelace"){for(const b of l){const P=r.get(w);if(!P||Number(P)<=0)break;C(b,w,l)}for(const b of p){const P=r.get(w);if(!P||Number(P)<=0)break;C(b,w,p)}for(const b of A){const P=r.get(w);if(!P||Number(P)<=0)break;C(b,w,A)}}for(const w of c){const b=r.get("lovelace");if(!b||Number(b)<=0)break;C(w,"lovelace",c)}for(const w of l){const b=r.get("lovelace");if(!b||Number(b)<=0)break;C(w,"lovelace",l)}for(const w of p){const b=r.get("lovelace");if(!b||Number(b)<=0)break;C(w,"lovelace",p)}for(const w of A){const b=r.get("lovelace");if(!b||Number(b)<=0)break;C(w,"lovelace",A)}for(const w of r.keys())if(Number(r.get(w))>0)return[];const E=[];for(const w of a){const b=n.get(w);b&&E.push(b)}return E},cn=(s,e)=>{for(const t of s.output.amount)if(t.unit==e)return t.quantity;return"0"};var zt={exports:{}},Hr={exports:{}},Le={exports:{}};(function(s){(function(e){var t,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,a=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",p=1e14,A=14,C=9007199254740991,E=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],w=1e7,b=1e9;function P(O){var M,W,Z,D=v.prototype={constructor:v,toString:null,valueOf:null},F=new v(1),q=20,J=4,nt=-7,lt=21,Ht=-1e7,At=1e7,Ft=!1,Zt=1,Tt=0,we={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Rt="0123456789abcdefghijklmnopqrstuvwxyz",Ce=!0;function v(o,u){var h,_,f,m,x,d,g,y,I=this;if(!(I instanceof v))return new v(o,u);if(u==null){if(o&&o._isBigNumber===!0){I.s=o.s,!o.c||o.e>At?I.c=I.e=null:o.e<Ht?I.c=[I.e=0]:(I.e=o.e,I.c=o.c.slice());return}if((d=typeof o=="number")&&o*0==0){if(I.s=1/o<0?(o=-o,-1):1,o===~~o){for(m=0,x=o;x>=10;x/=10,m++);m>At?I.c=I.e=null:(I.e=m,I.c=[o]);return}y=String(o)}else{if(!r.test(y=String(o)))return Z(I,y,d);I.s=y.charCodeAt(0)==45?(y=y.slice(1),-1):1}(m=y.indexOf("."))>-1&&(y=y.replace(".","")),(x=y.search(/e/i))>0?(m<0&&(m=x),m+=+y.slice(x+1),y=y.substring(0,x)):m<0&&(m=y.length)}else{if(Q(u,2,Rt.length,"Base"),u==10&&Ce)return I=new v(o),dt(I,q+I.e+1,J);if(y=String(o),d=typeof o=="number"){if(o*0!=0)return Z(I,y,d,u);if(I.s=1/o<0?(y=y.slice(1),-1):1,v.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(l+o)}else I.s=y.charCodeAt(0)===45?(y=y.slice(1),-1):1;for(h=Rt.slice(0,u),m=x=0,g=y.length;x<g;x++)if(h.indexOf(_=y.charAt(x))<0){if(_=="."){if(x>m){m=g;continue}}else if(!f&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){f=!0,x=-1,m=0;continue}return Z(I,String(o),d,u)}d=!1,y=W(y,u,10,I.s),(m=y.indexOf("."))>-1?y=y.replace(".",""):m=y.length}for(x=0;y.charCodeAt(x)===48;x++);for(g=y.length;y.charCodeAt(--g)===48;);if(y=y.slice(x,++g)){if(g-=x,d&&v.DEBUG&&g>15&&(o>C||o!==a(o)))throw Error(l+I.s*o);if((m=m-x-1)>At)I.c=I.e=null;else if(m<Ht)I.c=[I.e=0];else{if(I.e=m,I.c=[],x=(m+1)%A,m<0&&(x+=A),x<g){for(x&&I.c.push(+y.slice(0,x)),g-=A;x<g;)I.c.push(+y.slice(x,x+=A));x=A-(y=y.slice(x)).length}else x-=g;for(;x--;y+="0");I.c.push(+y)}}else I.c=[I.e=0]}v.clone=P,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(o){var u,h;if(o!=null)if(typeof o=="object"){if(o.hasOwnProperty(u="DECIMAL_PLACES")&&(h=o[u],Q(h,0,b,u),q=h),o.hasOwnProperty(u="ROUNDING_MODE")&&(h=o[u],Q(h,0,8,u),J=h),o.hasOwnProperty(u="EXPONENTIAL_AT")&&(h=o[u],h&&h.pop?(Q(h[0],-b,0,u),Q(h[1],0,b,u),nt=h[0],lt=h[1]):(Q(h,-b,b,u),nt=-(lt=h<0?-h:h))),o.hasOwnProperty(u="RANGE"))if(h=o[u],h&&h.pop)Q(h[0],-b,-1,u),Q(h[1],1,b,u),Ht=h[0],At=h[1];else if(Q(h,-b,b,u),h)Ht=-(At=h<0?-h:h);else throw Error(c+u+" cannot be zero: "+h);if(o.hasOwnProperty(u="CRYPTO"))if(h=o[u],h===!!h)if(h)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Ft=h;else throw Ft=!h,Error(c+"crypto unavailable");else Ft=h;else throw Error(c+u+" not true or false: "+h);if(o.hasOwnProperty(u="MODULO_MODE")&&(h=o[u],Q(h,0,9,u),Zt=h),o.hasOwnProperty(u="POW_PRECISION")&&(h=o[u],Q(h,0,b,u),Tt=h),o.hasOwnProperty(u="FORMAT"))if(h=o[u],typeof h=="object")we=h;else throw Error(c+u+" not an object: "+h);if(o.hasOwnProperty(u="ALPHABET"))if(h=o[u],typeof h=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(h))Ce=h.slice(0,10)=="0123456789",Rt=h;else throw Error(c+u+" invalid: "+h)}else throw Error(c+"Object expected: "+o);return{DECIMAL_PLACES:q,ROUNDING_MODE:J,EXPONENTIAL_AT:[nt,lt],RANGE:[Ht,At],CRYPTO:Ft,MODULO_MODE:Zt,POW_PRECISION:Tt,FORMAT:we,ALPHABET:Rt}},v.isBigNumber=function(o){if(!o||o._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var u,h,_=o.c,f=o.e,m=o.s;t:if({}.toString.call(_)=="[object Array]"){if((m===1||m===-1)&&f>=-b&&f<=b&&f===a(f)){if(_[0]===0){if(f===0&&_.length===1)return!0;break t}if(u=(f+1)%A,u<1&&(u+=A),String(_[0]).length==u){for(u=0;u<_.length;u++)if(h=_[u],h<0||h>=p||h!==a(h))break t;if(h!==0)return!0}}}else if(_===null&&f===null&&(m===null||m===1||m===-1))return!0;throw Error(c+"Invalid BigNumber: "+o)},v.maximum=v.max=function(){return Ge(arguments,-1)},v.minimum=v.min=function(){return Ge(arguments,1)},v.random=function(){var o=9007199254740992,u=Math.random()*o&2097151?function(){return a(Math.random()*o)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(h){var _,f,m,x,d,g=0,y=[],I=new v(F);if(h==null?h=q:Q(h,0,b),x=n(h/A),Ft)if(crypto.getRandomValues){for(_=crypto.getRandomValues(new Uint32Array(x*=2));g<x;)d=_[g]*131072+(_[g+1]>>>11),d>=9e15?(f=crypto.getRandomValues(new Uint32Array(2)),_[g]=f[0],_[g+1]=f[1]):(y.push(d%1e14),g+=2);g=x/2}else if(crypto.randomBytes){for(_=crypto.randomBytes(x*=7);g<x;)d=(_[g]&31)*281474976710656+_[g+1]*1099511627776+_[g+2]*4294967296+_[g+3]*16777216+(_[g+4]<<16)+(_[g+5]<<8)+_[g+6],d>=9e15?crypto.randomBytes(7).copy(_,g):(y.push(d%1e14),g+=7);g=x/7}else throw Ft=!1,Error(c+"crypto unavailable");if(!Ft)for(;g<x;)d=u(),d<9e15&&(y[g++]=d%1e14);for(x=y[--g],h%=A,x&&h&&(d=E[A-h],y[g]=a(x/d)*d);y[g]===0;y.pop(),g--);if(g<0)y=[m=0];else{for(m=-1;y[0]===0;y.splice(0,1),m-=A);for(g=1,d=y[0];d>=10;d/=10,g++);g<A&&(m-=A-g)}return I.e=m,I.c=y,I}}(),v.sum=function(){for(var o=1,u=arguments,h=new v(u[0]);o<u.length;)h=h.plus(u[o++]);return h},W=function(){var o="0123456789";function u(h,_,f,m){for(var x,d=[0],g,y=0,I=h.length;y<I;){for(g=d.length;g--;d[g]*=_);for(d[0]+=m.indexOf(h.charAt(y++)),x=0;x<d.length;x++)d[x]>f-1&&(d[x+1]==null&&(d[x+1]=0),d[x+1]+=d[x]/f|0,d[x]%=f)}return d.reverse()}return function(h,_,f,m,x){var d,g,y,I,B,U,K,L,tt=h.indexOf("."),rt=q,V=J;for(tt>=0&&(I=Tt,Tt=0,h=h.replace(".",""),L=new v(_),U=L.pow(h.length-tt),Tt=I,L.c=u($(N(U.c),U.e,"0"),10,f,o),L.e=L.c.length),K=u(h,_,f,x?(d=Rt,o):(d=o,Rt)),y=I=K.length;K[--I]==0;K.pop());if(!K[0])return d.charAt(0);if(tt<0?--y:(U.c=K,U.e=y,U.s=m,U=M(U,L,rt,V,f),K=U.c,B=U.r,y=U.e),g=y+rt+1,tt=K[g],I=f/2,B=B||g<0||K[g+1]!=null,B=V<4?(tt!=null||B)&&(V==0||V==(U.s<0?3:2)):tt>I||tt==I&&(V==4||B||V==6&&K[g-1]&1||V==(U.s<0?8:7)),g<1||!K[0])h=B?$(d.charAt(1),-rt,d.charAt(0)):d.charAt(0);else{if(K.length=g,B)for(--f;++K[--g]>f;)K[g]=0,g||(++y,K=[1].concat(K));for(I=K.length;!K[--I];);for(tt=0,h="";tt<=I;h+=d.charAt(K[tt++]));h=$(h,y,d.charAt(0))}return h}}(),M=function(){function o(_,f,m){var x,d,g,y,I=0,B=_.length,U=f%w,K=f/w|0;for(_=_.slice();B--;)g=_[B]%w,y=_[B]/w|0,x=K*g+y*U,d=U*g+x%w*w+I,I=(d/m|0)+(x/w|0)+K*y,_[B]=d%m;return I&&(_=[I].concat(_)),_}function u(_,f,m,x){var d,g;if(m!=x)g=m>x?1:-1;else for(d=g=0;d<m;d++)if(_[d]!=f[d]){g=_[d]>f[d]?1:-1;break}return g}function h(_,f,m,x){for(var d=0;m--;)_[m]-=d,d=_[m]<f[m]?1:0,_[m]=d*x+_[m]-f[m];for(;!_[0]&&_.length>1;_.splice(0,1));}return function(_,f,m,x,d){var g,y,I,B,U,K,L,tt,rt,V,z,it,ae,Se,ve,yt,te,ft=_.s==f.s?1:-1,ot=_.c,et=f.c;if(!ot||!ot[0]||!et||!et[0])return new v(!_.s||!f.s||(ot?et&&ot[0]==et[0]:!et)?NaN:ot&&ot[0]==0||!et?ft*0:ft/0);for(tt=new v(ft),rt=tt.c=[],y=_.e-f.e,ft=m+y+1,d||(d=p,y=k(_.e/A)-k(f.e/A),ft=ft/A|0),I=0;et[I]==(ot[I]||0);I++);if(et[I]>(ot[I]||0)&&y--,ft<0)rt.push(1),B=!0;else{for(Se=ot.length,yt=et.length,I=0,ft+=2,U=a(d/(et[0]+1)),U>1&&(et=o(et,U,d),ot=o(ot,U,d),yt=et.length,Se=ot.length),ae=yt,V=ot.slice(0,yt),z=V.length;z<yt;V[z++]=0);te=et.slice(),te=[0].concat(te),ve=et[0],et[1]>=d/2&&ve++;do{if(U=0,g=u(et,V,yt,z),g<0){if(it=V[0],yt!=z&&(it=it*d+(V[1]||0)),U=a(it/ve),U>1)for(U>=d&&(U=d-1),K=o(et,U,d),L=K.length,z=V.length;u(K,V,L,z)==1;)U--,h(K,yt<L?te:et,L,d),L=K.length,g=1;else U==0&&(g=U=1),K=et.slice(),L=K.length;if(L<z&&(K=[0].concat(K)),h(V,K,z,d),z=V.length,g==-1)for(;u(et,V,yt,z)<1;)U++,h(V,yt<z?te:et,z,d),z=V.length}else g===0&&(U++,V=[0]);rt[I++]=U,V[0]?V[z++]=ot[ae]||0:(V=[ot[ae]],z=1)}while((ae++<Se||V[0]!=null)&&ft--);B=V[0]!=null,rt[0]||rt.splice(0,1)}if(d==p){for(I=1,ft=rt[0];ft>=10;ft/=10,I++);dt(tt,m+(tt.e=I+y*A-1)+1,x,B)}else tt.e=y,tt.r=+B;return tt}}();function Be(o,u,h,_){var f,m,x,d,g;if(h==null?h=J:Q(h,0,8),!o.c)return o.toString();if(f=o.c[0],x=o.e,u==null)g=N(o.c),g=_==1||_==2&&(x<=nt||x>=lt)?X(g,x):$(g,x,"0");else if(o=dt(new v(o),u,h),m=o.e,g=N(o.c),d=g.length,_==1||_==2&&(u<=m||m<=nt)){for(;d<u;g+="0",d++);g=X(g,m)}else if(u-=x,g=$(g,m,"0"),m+1>d){if(--u>0)for(g+=".";u--;g+="0");}else if(u+=m-d,u>0)for(m+1==d&&(g+=".");u--;g+="0");return o.s<0&&f?"-"+g:g}function Ge(o,u){for(var h,_,f=1,m=new v(o[0]);f<o.length;f++)_=new v(o[f]),(!_.s||(h=T(m,_))===u||h===0&&m.s===u)&&(m=_);return m}function Ee(o,u,h){for(var _=1,f=u.length;!u[--f];u.pop());for(f=u[0];f>=10;f/=10,_++);return(h=_+h*A-1)>At?o.c=o.e=null:h<Ht?o.c=[o.e=0]:(o.e=h,o.c=u),o}Z=function(){var o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,h=/^\.([^.]+)$/,_=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(m,x,d,g){var y,I=d?x:x.replace(f,"");if(_.test(I))m.s=isNaN(I)?null:I<0?-1:1;else{if(!d&&(I=I.replace(o,function(B,U,K){return y=(K=K.toLowerCase())=="x"?16:K=="b"?2:8,!g||g==y?U:B}),g&&(y=g,I=I.replace(u,"$1").replace(h,"0.$1")),x!=I))return new v(I,y);if(v.DEBUG)throw Error(c+"Not a"+(g?" base "+g:"")+" number: "+x);m.s=null}m.c=m.e=null}}();function dt(o,u,h,_){var f,m,x,d,g,y,I,B=o.c,U=E;if(B){t:{for(f=1,d=B[0];d>=10;d/=10,f++);if(m=u-f,m<0)m+=A,x=u,g=B[y=0],I=a(g/U[f-x-1]%10);else if(y=n((m+1)/A),y>=B.length)if(_){for(;B.length<=y;B.push(0));g=I=0,f=1,m%=A,x=m-A+1}else break t;else{for(g=d=B[y],f=1;d>=10;d/=10,f++);m%=A,x=m-A+f,I=x<0?0:a(g/U[f-x-1]%10)}if(_=_||u<0||B[y+1]!=null||(x<0?g:g%U[f-x-1]),_=h<4?(I||_)&&(h==0||h==(o.s<0?3:2)):I>5||I==5&&(h==4||_||h==6&&(m>0?x>0?g/U[f-x]:0:B[y-1])%10&1||h==(o.s<0?8:7)),u<1||!B[0])return B.length=0,_?(u-=o.e+1,B[0]=U[(A-u%A)%A],o.e=-u||0):B[0]=o.e=0,o;if(m==0?(B.length=y,d=1,y--):(B.length=y+1,d=U[A-m],B[y]=x>0?a(g/U[f-x]%U[x])*d:0),_)for(;;)if(y==0){for(m=1,x=B[0];x>=10;x/=10,m++);for(x=B[0]+=d,d=1;x>=10;x/=10,d++);m!=d&&(o.e++,B[0]==p&&(B[0]=1));break}else{if(B[y]+=d,B[y]!=p)break;B[y--]=0,d=1}for(m=B.length;B[--m]===0;B.pop());}o.e>At?o.c=o.e=null:o.e<Ht&&(o.c=[o.e=0])}return o}function St(o){var u,h=o.e;return h===null?o.toString():(u=N(o.c),u=h<=nt||h>=lt?X(u,h):$(u,h,"0"),o.s<0?"-"+u:u)}return D.absoluteValue=D.abs=function(){var o=new v(this);return o.s<0&&(o.s=1),o},D.comparedTo=function(o,u){return T(this,new v(o,u))},D.decimalPlaces=D.dp=function(o,u){var h,_,f,m=this;if(o!=null)return Q(o,0,b),u==null?u=J:Q(u,0,8),dt(new v(m),o+m.e+1,u);if(!(h=m.c))return null;if(_=((f=h.length-1)-k(this.e/A))*A,f=h[f])for(;f%10==0;f/=10,_--);return _<0&&(_=0),_},D.dividedBy=D.div=function(o,u){return M(this,new v(o,u),q,J)},D.dividedToIntegerBy=D.idiv=function(o,u){return M(this,new v(o,u),0,1)},D.exponentiatedBy=D.pow=function(o,u){var h,_,f,m,x,d,g,y,I,B=this;if(o=new v(o),o.c&&!o.isInteger())throw Error(c+"Exponent not an integer: "+St(o));if(u!=null&&(u=new v(u)),d=o.e>14,!B.c||!B.c[0]||B.c[0]==1&&!B.e&&B.c.length==1||!o.c||!o.c[0])return I=new v(Math.pow(+St(B),d?o.s*(2-R(o)):+St(o))),u?I.mod(u):I;if(g=o.s<0,u){if(u.c?!u.c[0]:!u.s)return new v(NaN);_=!g&&B.isInteger()&&u.isInteger(),_&&(B=B.mod(u))}else{if(o.e>9&&(B.e>0||B.e<-1||(B.e==0?B.c[0]>1||d&&B.c[1]>=24e7:B.c[0]<8e13||d&&B.c[0]<=9999975e7)))return m=B.s<0&&R(o)?-0:0,B.e>-1&&(m=1/m),new v(g?1/m:m);Tt&&(m=n(Tt/A+2))}for(d?(h=new v(.5),g&&(o.s=1),y=R(o)):(f=Math.abs(+St(o)),y=f%2),I=new v(F);;){if(y){if(I=I.times(B),!I.c)break;m?I.c.length>m&&(I.c.length=m):_&&(I=I.mod(u))}if(f){if(f=a(f/2),f===0)break;y=f%2}else if(o=o.times(h),dt(o,o.e+1,1),o.e>14)y=R(o);else{if(f=+St(o),f===0)break;y=f%2}B=B.times(B),m?B.c&&B.c.length>m&&(B.c.length=m):_&&(B=B.mod(u))}return _?I:(g&&(I=F.div(I)),u?I.mod(u):m?dt(I,Tt,J,x):I)},D.integerValue=function(o){var u=new v(this);return o==null?o=J:Q(o,0,8),dt(u,u.e+1,o)},D.isEqualTo=D.eq=function(o,u){return T(this,new v(o,u))===0},D.isFinite=function(){return!!this.c},D.isGreaterThan=D.gt=function(o,u){return T(this,new v(o,u))>0},D.isGreaterThanOrEqualTo=D.gte=function(o,u){return(u=T(this,new v(o,u)))===1||u===0},D.isInteger=function(){return!!this.c&&k(this.e/A)>this.c.length-2},D.isLessThan=D.lt=function(o,u){return T(this,new v(o,u))<0},D.isLessThanOrEqualTo=D.lte=function(o,u){return(u=T(this,new v(o,u)))===-1||u===0},D.isNaN=function(){return!this.s},D.isNegative=function(){return this.s<0},D.isPositive=function(){return this.s>0},D.isZero=function(){return!!this.c&&this.c[0]==0},D.minus=function(o,u){var h,_,f,m,x=this,d=x.s;if(o=new v(o,u),u=o.s,!d||!u)return new v(NaN);if(d!=u)return o.s=-u,x.plus(o);var g=x.e/A,y=o.e/A,I=x.c,B=o.c;if(!g||!y){if(!I||!B)return I?(o.s=-u,o):new v(B?x:NaN);if(!I[0]||!B[0])return B[0]?(o.s=-u,o):new v(I[0]?x:J==3?-0:0)}if(g=k(g),y=k(y),I=I.slice(),d=g-y){for((m=d<0)?(d=-d,f=I):(y=g,f=B),f.reverse(),u=d;u--;f.push(0));f.reverse()}else for(_=(m=(d=I.length)<(u=B.length))?d:u,d=u=0;u<_;u++)if(I[u]!=B[u]){m=I[u]<B[u];break}if(m&&(f=I,I=B,B=f,o.s=-o.s),u=(_=B.length)-(h=I.length),u>0)for(;u--;I[h++]=0);for(u=p-1;_>d;){if(I[--_]<B[_]){for(h=_;h&&!I[--h];I[h]=u);--I[h],I[_]+=p}I[_]-=B[_]}for(;I[0]==0;I.splice(0,1),--y);return I[0]?Ee(o,I,y):(o.s=J==3?-1:1,o.c=[o.e=0],o)},D.modulo=D.mod=function(o,u){var h,_,f=this;return o=new v(o,u),!f.c||!o.s||o.c&&!o.c[0]?new v(NaN):!o.c||f.c&&!f.c[0]?new v(f):(Zt==9?(_=o.s,o.s=1,h=M(f,o,0,3),o.s=_,h.s*=_):h=M(f,o,0,Zt),o=f.minus(h.times(o)),!o.c[0]&&Zt==1&&(o.s=f.s),o)},D.multipliedBy=D.times=function(o,u){var h,_,f,m,x,d,g,y,I,B,U,K,L,tt,rt,V=this,z=V.c,it=(o=new v(o,u)).c;if(!z||!it||!z[0]||!it[0])return!V.s||!o.s||z&&!z[0]&&!it||it&&!it[0]&&!z?o.c=o.e=o.s=null:(o.s*=V.s,!z||!it?o.c=o.e=null:(o.c=[0],o.e=0)),o;for(_=k(V.e/A)+k(o.e/A),o.s*=V.s,g=z.length,B=it.length,g<B&&(L=z,z=it,it=L,f=g,g=B,B=f),f=g+B,L=[];f--;L.push(0));for(tt=p,rt=w,f=B;--f>=0;){for(h=0,U=it[f]%rt,K=it[f]/rt|0,x=g,m=f+x;m>f;)y=z[--x]%rt,I=z[x]/rt|0,d=K*y+I*U,y=U*y+d%rt*rt+L[m]+h,h=(y/tt|0)+(d/rt|0)+K*I,L[m--]=y%tt;L[m]=h}return h?++_:L.splice(0,1),Ee(o,L,_)},D.negated=function(){var o=new v(this);return o.s=-o.s||null,o},D.plus=function(o,u){var h,_=this,f=_.s;if(o=new v(o,u),u=o.s,!f||!u)return new v(NaN);if(f!=u)return o.s=-u,_.minus(o);var m=_.e/A,x=o.e/A,d=_.c,g=o.c;if(!m||!x){if(!d||!g)return new v(f/0);if(!d[0]||!g[0])return g[0]?o:new v(d[0]?_:f*0)}if(m=k(m),x=k(x),d=d.slice(),f=m-x){for(f>0?(x=m,h=g):(f=-f,h=d),h.reverse();f--;h.push(0));h.reverse()}for(f=d.length,u=g.length,f-u<0&&(h=g,g=d,d=h,u=f),f=0;u;)f=(d[--u]=d[u]+g[u]+f)/p|0,d[u]=p===d[u]?0:d[u]%p;return f&&(d=[f].concat(d),++x),Ee(o,d,x)},D.precision=D.sd=function(o,u){var h,_,f,m=this;if(o!=null&&o!==!!o)return Q(o,1,b),u==null?u=J:Q(u,0,8),dt(new v(m),o,u);if(!(h=m.c))return null;if(f=h.length-1,_=f*A+1,f=h[f]){for(;f%10==0;f/=10,_--);for(f=h[0];f>=10;f/=10,_++);}return o&&m.e+1>_&&(_=m.e+1),_},D.shiftedBy=function(o){return Q(o,-C,C),this.times("1e"+o)},D.squareRoot=D.sqrt=function(){var o,u,h,_,f,m=this,x=m.c,d=m.s,g=m.e,y=q+4,I=new v("0.5");if(d!==1||!x||!x[0])return new v(!d||d<0&&(!x||x[0])?NaN:x?m:1/0);if(d=Math.sqrt(+St(m)),d==0||d==1/0?(u=N(x),(u.length+g)%2==0&&(u+="0"),d=Math.sqrt(+u),g=k((g+1)/2)-(g<0||g%2),d==1/0?u="5e"+g:(u=d.toExponential(),u=u.slice(0,u.indexOf("e")+1)+g),h=new v(u)):h=new v(d+""),h.c[0]){for(g=h.e,d=g+y,d<3&&(d=0);;)if(f=h,h=I.times(f.plus(M(m,f,y,1))),N(f.c).slice(0,d)===(u=N(h.c)).slice(0,d))if(h.e<g&&--d,u=u.slice(d-3,d+1),u=="9999"||!_&&u=="4999"){if(!_&&(dt(f,f.e+q+2,0),f.times(f).eq(m))){h=f;break}y+=4,d+=4,_=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(dt(h,h.e+q+2,1),o=!h.times(h).eq(m));break}}return dt(h,h.e+q+1,J,o)},D.toExponential=function(o,u){return o!=null&&(Q(o,0,b),o++),Be(this,o,u,1)},D.toFixed=function(o,u){return o!=null&&(Q(o,0,b),o=o+this.e+1),Be(this,o,u)},D.toFormat=function(o,u,h){var _,f=this;if(h==null)o!=null&&u&&typeof u=="object"?(h=u,u=null):o&&typeof o=="object"?(h=o,o=u=null):h=we;else if(typeof h!="object")throw Error(c+"Argument not an object: "+h);if(_=f.toFixed(o,u),f.c){var m,x=_.split("."),d=+h.groupSize,g=+h.secondaryGroupSize,y=h.groupSeparator||"",I=x[0],B=x[1],U=f.s<0,K=U?I.slice(1):I,L=K.length;if(g&&(m=d,d=g,g=m,L-=m),d>0&&L>0){for(m=L%d||d,I=K.substr(0,m);m<L;m+=d)I+=y+K.substr(m,d);g>0&&(I+=y+K.slice(m)),U&&(I="-"+I)}_=B?I+(h.decimalSeparator||"")+((g=+h.fractionGroupSize)?B.replace(new RegExp("\\d{"+g+"}\\B","g"),"$&"+(h.fractionGroupSeparator||"")):B):I}return(h.prefix||"")+_+(h.suffix||"")},D.toFraction=function(o){var u,h,_,f,m,x,d,g,y,I,B,U,K=this,L=K.c;if(o!=null&&(d=new v(o),!d.isInteger()&&(d.c||d.s!==1)||d.lt(F)))throw Error(c+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+St(d));if(!L)return new v(K);for(u=new v(F),y=h=new v(F),_=g=new v(F),U=N(L),m=u.e=U.length-K.e-1,u.c[0]=E[(x=m%A)<0?A+x:x],o=!o||d.comparedTo(u)>0?m>0?u:y:d,x=At,At=1/0,d=new v(U),g.c[0]=0;I=M(d,u,0,1),f=h.plus(I.times(_)),f.comparedTo(o)!=1;)h=_,_=f,y=g.plus(I.times(f=y)),g=f,u=d.minus(I.times(f=u)),d=f;return f=M(o.minus(h),_,0,1),g=g.plus(f.times(y)),h=h.plus(f.times(_)),g.s=y.s=K.s,m=m*2,B=M(y,_,m,J).minus(K).abs().comparedTo(M(g,h,m,J).minus(K).abs())<1?[y,_]:[g,h],At=x,B},D.toNumber=function(){return+St(this)},D.toPrecision=function(o,u){return o!=null&&Q(o,1,b),Be(this,o,u,2)},D.toString=function(o){var u,h=this,_=h.s,f=h.e;return f===null?_?(u="Infinity",_<0&&(u="-"+u)):u="NaN":(o==null?u=f<=nt||f>=lt?X(N(h.c),f):$(N(h.c),f,"0"):o===10&&Ce?(h=dt(new v(h),q+f+1,J),u=$(N(h.c),h.e,"0")):(Q(o,2,Rt.length,"Base"),u=W($(N(h.c),f,"0"),10,o,_,!0)),_<0&&h.c[0]&&(u="-"+u)),u},D.valueOf=D.toJSON=function(){return St(this)},D._isBigNumber=!0,O!=null&&v.set(O),v}function k(O){var M=O|0;return O>0||O===M?M:M-1}function N(O){for(var M,W,Z=1,D=O.length,F=O[0]+"";Z<D;){for(M=O[Z++]+"",W=A-M.length;W--;M="0"+M);F+=M}for(D=F.length;F.charCodeAt(--D)===48;);return F.slice(0,D+1||1)}function T(O,M){var W,Z,D=O.c,F=M.c,q=O.s,J=M.s,nt=O.e,lt=M.e;if(!q||!J)return null;if(W=D&&!D[0],Z=F&&!F[0],W||Z)return W?Z?0:-J:q;if(q!=J)return q;if(W=q<0,Z=nt==lt,!D||!F)return Z?0:!D^W?1:-1;if(!Z)return nt>lt^W?1:-1;for(J=(nt=D.length)<(lt=F.length)?nt:lt,q=0;q<J;q++)if(D[q]!=F[q])return D[q]>F[q]^W?1:-1;return nt==lt?0:nt>lt^W?1:-1}function Q(O,M,W,Z){if(O<M||O>W||O!==a(O))throw Error(c+(Z||"Argument")+(typeof O=="number"?O<M||O>W?" out of range: ":" not an integer: ":" not a primitive number: ")+String(O))}function R(O){var M=O.c.length-1;return k(O.e/A)==M&&O.c[M]%2!=0}function X(O,M){return(O.length>1?O.charAt(0)+"."+O.slice(1):O)+(M<0?"e":"e+")+M}function $(O,M,W){var Z,D;if(M<0){for(D=W+".";++M;D+=W);O=D+O}else if(Z=O.length,++M>Z){for(D=W,M-=Z;--M;D+=W);O+=D}else M<Z&&(O=O.slice(0,M)+"."+O.slice(M));return O}t=P(),t.default=t.BigNumber=t,s.exports?s.exports=t:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=t)})(ke)})(Le);(function(s){var e=Le.exports,t=s.exports;(function(){var r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,a,c={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;function p(C){return r.lastIndex=0,r.test(C)?'"'+C.replace(r,function(E){var w=c[E];return typeof w=="string"?w:"\\u"+("0000"+E.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+C+'"'}function A(C,E){var w,b,P,k,N=n,T,Q=E[C],R=Q!=null&&(Q instanceof e||e.isBigNumber(Q));switch(Q&&typeof Q=="object"&&typeof Q.toJSON=="function"&&(Q=Q.toJSON(C)),typeof l=="function"&&(Q=l.call(E,C,Q)),typeof Q){case"string":return R?Q:p(Q);case"number":return isFinite(Q)?String(Q):"null";case"boolean":case"null":case"bigint":return String(Q);case"object":if(!Q)return"null";if(n+=a,T=[],Object.prototype.toString.apply(Q)==="[object Array]"){for(k=Q.length,w=0;w<k;w+=1)T[w]=A(w,Q)||"null";return P=T.length===0?"[]":n?`[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`+
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`,r:"\r",t:" "},a,c=function(k){throw{name:"SyntaxError",message:k,at:t,text:a}},l=function(k){return k&&k!==r&&c("Expected '"+k+"' instead of '"+r+"'"),r=a.charAt(t),t+=1,r},p=function(){var k,N="";for(r==="-"&&(N="-",l("-"));r>="0"&&r<="9";)N+=r,l();if(r===".")for(N+=".";l()&&r>="0"&&r<="9";)N+=r;if(r==="e"||r==="E")for(N+=r,l(),(r==="-"||r==="+")&&(N+=r,l());r>="0"&&r<="9";)N+=r,l();if(k=+N,!isFinite(k))c("Bad number");else return he==null&&(he=Le.exports),N.length>15?e.storeAsString?N:e.useNativeBigInt?BigInt(N):new he(N):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(k):new he(k):k},A=function(){var k,N,T="",Q;if(r==='"')for(var R=t;l();){if(r==='"')return t-1>R&&(T+=a.substring(R,t-1)),l(),T;if(r==="\\"){if(t-1>R&&(T+=a.substring(R,t-1)),l(),r==="u"){for(Q=0,N=0;N<4&&(k=parseInt(l(),16),!!isFinite(k));N+=1)Q=Q*16+k;T+=String.fromCharCode(Q)}else if(typeof n[r]=="string")T+=n[r];else break;R=t}}c("Bad string")},C=function(){for(;r&&r<=" ";)l()},E=function(){switch(r){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}c("Unexpected '"+r+"'")},w,b=function(){var k=[];if(r==="["){if(l("["),C(),r==="]")return l("]"),k;for(;r;){if(k.push(w()),C(),r==="]")return l("]"),k;l(","),C()}}c("Bad array")},P=function(){var k,N=Object.create(null);if(r==="{"){if(l("{"),C(),r==="}")return l("}"),N;for(;r;){if(k=A(),C(),l(":"),e.strict===!0&&Object.hasOwnProperty.call(N,k)&&c('Duplicate key "'+k+'"'),un.test(k)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?w():N[k]=w():ln.test(k)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?w():N[k]=w():N[k]=w(),C(),r==="}")return l("}"),N;l(","),C()}}c("Bad object")};return w=function(){switch(C(),r){case"{":return P();case"[":return b();case'"':return A();case"-":return p();default:return r>="0"&&r<="9"?p():E()}},function(k,N){var T;return a=k+"",t=0,r=" ",T=w(),C(),r&&c("Syntax error"),typeof N=="function"?function Q(R,X){var $,O=R[X];return O&&typeof O=="object"&&Object.keys(O).forEach(function(M){$=Q(O,M),$!==void 0?O[M]=$:delete O[M]}),N.call(R,X,O)}({"":T},""):T}},dn=hn,Fr=Hr.exports.stringify,Rr=dn;zt.exports=function(s){return{parse:Rr(s),stringify:Fr}};zt.exports.parse=Rr();zt.exports.stringify=Fr;class fn{txHex="";txBuilder=ge();txEvaluationMultiplier=1.1;_protocolParams=gt;txOutput;addingScriptInput=!1;addingPlutusMint=!1;isHydra=!1;meshTxBuilderBody;mintItem;txInQueueItem;collateralQueueItem;refScriptTxInQueueItem;reset=()=>(this.txHex="",this.txBuilder=ge(),this.txEvaluationMultiplier=1.1,this._protocolParams=gt,this.txOutput=void 0,this.addingScriptInput=!1,this.addingPlutusMint=!1,this.mintItem=void 0,this.txInQueueItem=void 0,this.collateralQueueItem=void 0,this.refScriptTxInQueueItem=void 0,this.meshTxBuilderBody=this.emptyTxBuilderBody(),this);emptyTxBuilderBody=()=>({inputs:[],outputs:[],extraInputs:[],selectionThreshold:0,collaterals:[],requiredSignatures:[],referenceInputs:[],mints:[],changeAddress:"",metadata:[],validityRange:{},certificates:[],signingKey:[]});constructor(){this.meshTxBuilderBody=this.emptyTxBuilderBody()}completeSync=e=>(e?this.meshTxBuilderBody=e:this.queueAllLastItem(),this.serializeTxBody(this.meshTxBuilderBody));completeSigning=()=>{const{signingKey:e}=this.meshTxBuilderBody;return e.length>0&&this.addAllSigningKeys(e),this.txHex};serializeTxBody=e=>{const{inputs:t,outputs:r,extraInputs:n,selectionThreshold:a,collaterals:c,referenceInputs:l,mints:p,changeAddress:A,certificates:C,validityRange:E,requiredSignatures:w,metadata:b}=e;if(this.isHydra?this.protocolParams({minFeeA:0,minFeeB:0,priceMem:0,priceStep:0,collateralPercent:0,coinsPerUTxOSize:"0"}):this.protocolParams({}),n.length>0&&this.addUtxosFrom(n,String(a)),this.removeDuplicateInputs(),this.meshTxBuilderBody.mints.sort((P,k)=>P.policyId.localeCompare(k.policyId)),this.meshTxBuilderBody.inputs.sort((P,k)=>P.txIn.txHash===k.txIn.txHash?P.txIn.txIndex-k.txIn.txIndex:P.txIn.txHash.localeCompare(k.txIn.txHash)),this.addAllInputs(t),this.addAllOutputs(r),this.addAllCollaterals(c),this.addAllReferenceInputs(l),this.addAllMints(p),this.addAllCertificates(C),this.addValidityRange(E),this.addAllRequiredSignatures(w),this.addAllMetadata(b),this.addCostModels(),A){const P=this.meshTxBuilderBody.collaterals.map(T=>{var Q,R;return((R=(Q=T.txIn.amount)==null?void 0:Q.find(X=>X.unit==="lovelace"))==null?void 0:R.quantity)||"0"}).reduce((T,Q)=>T+parseInt(Q),0),k=Math.ceil(this._protocolParams.collateralPercent*Number(Number(this.txBuilder.min_fee().checked_add(i.BigNum.from_str("10000")).to_js_value()))/100);let N=!1;if(P-k>0){const T=i.TransactionOutput.new(i.Address.from_bech32(A),i.Value.new(i.BigNum.from_str(String(k))));P-k>Number(i.min_ada_for_output(T,i.DataCost.new_coins_per_byte(i.BigNum.from_str(this._protocolParams.coinsPerUTxOSize))).to_js_value())&&(this.txBuilder.set_collateral_return(i.TransactionOutput.new(i.Address.from_bech32(A),i.Value.new(i.BigNum.from_str(String(P))))),this.txBuilder.set_total_collateral(i.BigNum.from_str(String(P))),N=!0)}this.addChange(A),N&&this.addCollateralReturn(A)}return this.buildTx(),this};txIn=(e,t,r,n)=>(this.txInQueueItem&&this.queueInput(),this.addingScriptInput?this.txInQueueItem={type:"Script",txIn:{txHash:e,txIndex:t,amount:r,address:n},scriptTxIn:{}}:this.txInQueueItem={type:"PubKey",txIn:{txHash:e,txIndex:t,amount:r,address:n}},this.addingScriptInput=!1,this);txInScript=(e,t="V2")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Datum value attempted to be called a non script input");return this.txInQueueItem.scriptTxIn.scriptSource={type:"Provided",script:{code:e,version:t}},this};txInDatumValue=(e,t="Mesh")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Datum value attempted to be called a non script input");let r=e;return t==="JSON"&&(r=this.castRawDataToJsonString(e)),t==="Mesh"?(this.txInQueueItem.scriptTxIn.datumSource={type:"Provided",data:{type:t,content:e}},this):(this.txInQueueItem.scriptTxIn.datumSource={type:"Provided",data:{type:t,content:r}},this)};txInInlineDatumPresent=()=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Inline datum present attempted to be called a non script input");const{txHash:e,txIndex:t}=this.txInQueueItem.txIn;return e&&t.toString()&&(this.txInQueueItem.scriptTxIn.datumSource={type:"Inline",txHash:e,txIndex:t}),this};txInRedeemerValue=(e,t={...Gt},r="Mesh")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Spending tx in reference redeemer attempted to be called a non script input");let n=e;return r==="Mesh"?(this.txInQueueItem.scriptTxIn.redeemer={data:{type:r,content:e},exUnits:t},this):(r==="JSON"&&(n=this.castRawDataToJsonString(e)),this.txInQueueItem.scriptTxIn.redeemer={data:{type:r,content:n},exUnits:t},this)};txOut=(e,t)=>(this.txOutput&&(this.meshTxBuilderBody.outputs.push(this.txOutput),this.txOutput=void 0),this.txOutput={address:e,amount:t},this);txOutDatumHashValue=(e,t="Mesh")=>{let r=e;if(this.txOutput){if(t==="Mesh")return this.txOutput.datum={type:"Hash",data:{type:t,content:r}},this;t==="JSON"&&(r=this.castRawDataToJsonString(e)),this.txOutput.datum={type:"Hash",data:{type:t,content:r}}}return this};txOutInlineDatumValue=(e,t="Mesh")=>{let r=e;if(this.txOutput){if(t==="Mesh")return this.txOutput.datum={type:"Inline",data:{type:t,content:r}},this;t==="JSON"&&(r=this.castRawDataToJsonString(e)),this.txOutput.datum={type:"Inline",data:{type:t,content:r}}}return this};txOutReferenceScript=(e,t="V2")=>(this.txOutput&&(this.txOutput.referenceScript={code:e,version:t}),this);spendingPlutusScriptV2=()=>(this.addingScriptInput=!0,this);spendingTxInReference=(e,t,r,n="V2")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Spending tx in reference attempted to be called a non script input");return this.txInQueueItem.scriptTxIn.scriptSource={type:"Inline",txInInfo:{txHash:e,txIndex:t,spendingScriptHash:r,version:n}},this};spendingReferenceTxInInlineDatumPresent=()=>(this.txInInlineDatumPresent(),this);spendingReferenceTxInRedeemerValue=(e,t={...Gt},r="Mesh")=>(this.txInRedeemerValue(e,t,r),this);readOnlyTxInReference=(e,t)=>(this.meshTxBuilderBody.referenceInputs.push({txHash:e,txIndex:t}),this);mintPlutusScriptV2=()=>(this.addingPlutusMint=!0,this);mint=(e,t,r)=>(this.mintItem&&this.queueMint(),this.mintItem={type:this.addingPlutusMint?"Plutus":"Native",policyId:t,assetName:r,amount:e},this.addingPlutusMint=!1,this);mintingScript=(e,t="V2")=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.type)throw Error("Mint information missing");return this.mintItem.scriptSource={type:"Provided",script:{code:e,version:t}},this};mintTxInReference=(e,t,r="V2")=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.type)throw Error("Mint information missing");if(this.mintItem.type=="Native")throw Error("Mint tx in reference can only be used on plutus script tokens");if(!this.mintItem.policyId)throw Error("PolicyId information missing from mint asset");return this.mintItem.scriptSource={type:"Reference Script",txHash:e,txIndex:t,version:r},this};mintReferenceTxInRedeemerValue=(e,t={...Gt},r="Mesh")=>{if(!this.mintItem)throw Error("Undefined mint");if(this.mintItem.type=="Native")throw Error("Mint tx in reference can only be used on plutus script tokens");if(this.mintItem.type=="Plutus"){if(!this.mintItem.policyId)throw Error("PolicyId information missing from mint asset");let n=e;if(r==="Mesh")return this.mintItem.redeemer={data:{type:r,content:n},exUnits:t},this;r==="JSON"&&(n=this.castRawDataToJsonString(e)),this.mintItem.redeemer={data:{type:r,content:n},exUnits:t}}return this};mintRedeemerValue=(e,t={...Gt},r="Mesh")=>(this.mintReferenceTxInRedeemerValue(e,t,r),this);requiredSignerHash=e=>(this.meshTxBuilderBody.requiredSignatures.push(e),this);txInCollateral=(e,t,r,n)=>(this.collateralQueueItem&&this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem),this.collateralQueueItem={type:"PubKey",txIn:{txHash:e,txIndex:t,amount:r,address:n}},this);registerPoolCertificate=e=>(this.meshTxBuilderBody.certificates.push({type:"RegisterPool",poolParams:e}),this);registerStakeCertificate=e=>(this.meshTxBuilderBody.certificates.push({type:"RegisterStake",stakeKeyHash:e}),this);delegateStakeCertificate=(e,t)=>(this.meshTxBuilderBody.certificates.push({type:"DelegateStake",stakeKeyHash:e,poolId:t}),this);deregisterStakeCertificate=e=>(this.meshTxBuilderBody.certificates.push({type:"DeregisterStake",stakeKeyHash:e}),this);retirePoolCertificate=(e,t)=>(this.meshTxBuilderBody.certificates.push({type:"RetirePool",poolId:e,epoch:t}),this);changeAddress=e=>(this.meshTxBuilderBody.changeAddress=e,this);invalidBefore=e=>(this.meshTxBuilderBody.validityRange.invalidBefore=e,this);invalidHereafter=e=>(this.meshTxBuilderBody.validityRange.invalidHereafter=e,this);metadataValue=(e,t)=>(this.meshTxBuilderBody.metadata.push({tag:e,metadata:t}),this);protocolParams=e=>{const t={...gt,...e};return this._protocolParams=t,this.txBuilder=ge(t),this};signingKey=e=>(this.meshTxBuilderBody.signingKey.push(e),this);selectUtxosFrom=(e,t=5e6)=>(this.meshTxBuilderBody.extraInputs=e,this.meshTxBuilderBody.selectionThreshold=t,this);addUtxosFrom=(e,t)=>{const r=this.meshTxBuilderBody.outputs.reduce((a,c)=>(c.amount.forEach(p=>{const{unit:A,quantity:C}=p,E=Number(a.get(A))||0;a.set(A,String(E+Number(C)))}),a),new Map);this.meshTxBuilderBody.inputs.reduce((a,c)=>{const l=c.txIn.amount;return l==null||l.forEach(p=>{const{unit:A,quantity:C}=p,E=Number(a.get(A))||0;a.set(A,String(E-Number(C)))}),a},r),this.meshTxBuilderBody.mints.reduce((a,c)=>{const l={unit:c.policyId+c.assetName,quantity:String(c.amount)},p=Number(a.get(l.unit))||0;return a.set(l.unit,String(p-Number(l.quantity))),a},r),on(e,r,t).forEach(a=>{this.addTxIn({type:"PubKey",txIn:{txHash:a.input.txHash,txIndex:a.input.outputIndex,amount:a.output.amount,address:a.output.address}})})};addAllSigningKeys=e=>{if(e.length>0){const t=i.Vkeywitnesses.new(),r=i.Transaction.from_hex(this.txHex),n=r.body();e.forEach(l=>{const p=l.slice(0,4)==="5820"?l.slice(4):l,A=i.PrivateKey.from_hex(p),C=i.make_vkey_witness(i.hash_transaction(n),A);t.add(C)});const a=r.witness_set();a.set_vkeys(t);const c=i.Transaction.new(n,a,r.auxiliary_data());this.txHex=c.to_hex()}};buildTx=()=>{const e=this.txBuilder.build_tx();this.txHex=e.to_hex()};queueInput=()=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="Script")if(this.txInQueueItem.scriptTxIn){if(!this.txInQueueItem.scriptTxIn.datumSource)throw Error("Script input does not contain datum information");if(!this.txInQueueItem.scriptTxIn.redeemer)throw Error("Script input does not contain redeemer information");if(!this.txInQueueItem.scriptTxIn.scriptSource)throw Error("Script input does not contain script information")}else throw Error("Script input does not contain script, datum, or redeemer information");this.meshTxBuilderBody.inputs.push(this.txInQueueItem),this.txInQueueItem=void 0};queueMint=()=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.scriptSource)throw Error("Missing mint script information");this.meshTxBuilderBody.mints.push(this.mintItem),this.mintItem=void 0};makePlutusScriptSource=e=>{const t=i.ScriptHash.from_hex(e.spendingScriptHash),r=i.TransactionInput.new(i.TransactionHash.from_hex(e.txHash),e.txIndex);return i.PlutusScriptSource.new_ref_input_with_lang_ver(t,r,vt[e.version])};removeDuplicateInputs=()=>{const e=this.meshTxBuilderBody.inputs,t=n=>`${n.txHash}#${n.txIndex}`,r=[];for(let n=0;n<e.length;n++){const a=t(e[n].txIn);r.includes(a)?(e.splice(n,1),n--):r.push(a)}};addAllInputs=e=>{for(let t=0;t<e.length;t++){const r=e[t];switch(r.type){case"PubKey":this.addTxIn(r);break;case"Script":this.addScriptTxIn(r);break}}};addTxIn=e=>{this.txBuilder.add_input(i.Address.from_bech32(e.txIn.address),i.TransactionInput.new(i.TransactionHash.from_hex(e.txIn.txHash),e.txIn.txIndex),Qt(e.txIn.amount))};addScriptTxIn=({scriptTxIn:e,txIn:t})=>{let r;const{datumSource:n,scriptSource:a,redeemer:c}=e;if(n.type==="Provided")r=i.DatumSource.new(this.castDataToPlutusData(n.data));else{const A=i.TransactionInput.new(i.TransactionHash.from_hex(n.txHash),n.txIndex);r=i.DatumSource.new_ref_input(A)}let l;a.type=="Inline"?l=this.makePlutusScriptSource(a.txInInfo):l=i.PlutusScriptSource.new(i.PlutusScript.from_hex_with_version(a.script.code,vt[a.script.version]));const p=i.Redeemer.new(i.RedeemerTag.new_spend(),i.BigNum.from_str("0"),this.castDataToPlutusData(c.data),i.ExUnits.new(i.BigNum.from_str(String(c.exUnits.mem)),i.BigNum.from_str(String(c.exUnits.steps))));this.txBuilder.add_plutus_script_input(i.PlutusWitness.new_with_ref(l,r,p),i.TransactionInput.new(i.TransactionHash.from_hex(t.txHash),t.txIndex),Qt(t.amount))};addAllOutputs=e=>{for(let t=0;t<e.length;t++){const r=e[t];this.addOutput(r)}};addOutput=({amount:e,address:t,datum:r,referenceScript:n})=>{const a=Qt(e),c=a.multiasset();if(a.is_zero()&&c===void 0)throw Error("Invalid output amount");let l=i.TransactionOutputBuilder.new().with_address(_t(t));r&&r.type==="Hash"&&(l=l.with_data_hash(i.hash_plutus_data(this.castDataToPlutusData(r.data)))),r&&r.type==="Inline"&&(l=l.with_plutus_data(this.castDataToPlutusData(r.data))),n&&(l=l.with_script_ref(i.ScriptRef.new_plutus_script(i.PlutusScript.from_hex_with_version(n.code,vt[n.version]))));const p=l.next();if(c){const A=a.coin().is_zero()?p.with_asset_and_min_required_coin_by_utxo_cost(c,Ne(this._protocolParams.coinsPerUTxOSize)).build():p.with_coin_and_asset(a.coin(),c).build();this.txBuilder.add_output(A)}else{const A=p.with_coin(a.coin()).build();this.txBuilder.add_output(A)}};addAllCollaterals=e=>{const t=i.TxInputsBuilder.new();for(let r=0;r<e.length;r++){const n=e[r];this.addCollateral(t,n)}this.txBuilder.set_collateral(t)};addCollateral=(e,t)=>{e.add_input(i.Address.from_bech32(t.txIn.address),i.TransactionInput.new(i.TransactionHash.from_hex(t.txIn.txHash),t.txIn.txIndex),Qt(t.txIn.amount))};addCollateralReturn=e=>{var r;const t=(r=this.txBuilder.get_fee_if_set())==null?void 0:r.to_js_value();if(t){const n=Math.ceil(this._protocolParams.collateralPercent*Number(t)/100);this.txBuilder.set_total_collateral_and_return(i.BigNum.from_str(String(n)),i.Address.from_bech32(e))}};addAllReferenceInputs=e=>{e.forEach(t=>{this.addReferenceInput(t)})};addReferenceInput=({txHash:e,txIndex:t})=>{const r=i.TransactionInput.new(i.TransactionHash.from_hex(e),t);this.txBuilder.add_reference_input(r)};addAllMints=e=>{const t=i.MintBuilder.new();let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(!a.scriptSource)throw Error("Mint script is expected to be provided");if(a.type==="Plutus"){if(!a.redeemer)throw Error("Missing mint redeemer information");this.addPlutusMint(t,a,r),r++}else a.type==="Native"&&this.addNativeMint(t,a)}this.txBuilder.set_mint_builder(t)};addPlutusMint=(e,{redeemer:t,policyId:r,scriptSource:n,assetName:a,amount:c},l)=>{const p=i.Redeemer.new(i.RedeemerTag.new_mint(),i.BigNum.from_str(String(l)),this.castDataToPlutusData(t.data),i.ExUnits.new(i.BigNum.from_str(String(t.exUnits.mem)),i.BigNum.from_str(String(t.exUnits.steps)))),A=n.type==="Reference Script"?i.PlutusScriptSource.new_ref_input_with_lang_ver(i.ScriptHash.from_hex(r),i.TransactionInput.new(i.TransactionHash.from_hex(n.txHash),n.txIndex),vt[n.version]):i.PlutusScriptSource.new(i.PlutusScript.from_hex_with_version(n.script.code,vt[n.script.version]));e.add_asset(i.MintWitness.new_plutus_script(A,p),i.AssetName.new(Buffer.from(a,"hex")),i.Int.from_str(c))};addNativeMint=(e,{scriptSource:t,assetName:r,amount:n})=>{if(t.type==="Reference Script")throw Error("Native mint cannot have reference script");e.add_asset(i.MintWitness.new_native_script(i.NativeScript.from_hex(t.script.code)),i.AssetName.new(Buffer.from(r,"hex")),i.Int.from_str(n))};decimalToFraction(e){const t=10**e.toString().split(".")[1].length;return[e*t,t]}toPoolParams=e=>{const t=this.decimalToFraction(e.margin),r=i.Relays.new();e.relays.forEach(c=>{r.add(Nr(c))});const n=i.RewardAddress.from_address(i.Address.from_bech32(e.rewardAddress));if(n===void 0)throw new Error("Reward address is invalid");const a=i.Ed25519KeyHashes.new();return e.owners.forEach(c=>{a.add(i.Ed25519KeyHash.from_hex(c))}),i.PoolParams.new(i.Ed25519KeyHash.from_hex(e.operator),i.VRFKeyHash.from_hex(e.VRFKeyHash),i.BigNum.from_str(e.pledge),i.BigNum.from_str(e.cost),i.UnitInterval.new(i.BigNum.from_str(t[0].toString()),i.BigNum.from_str(t[1].toString())),n,a,r,e.metadata?i.PoolMetadata.from_json(zt.exports.stringify(e.metadata)):void 0)};addCertificate=(e,t)=>{switch(t.type){case"RegisterPool":e.add(i.Certificate.new_pool_registration(i.PoolRegistration.new(this.toPoolParams(t.poolParams))));break;case"RegisterStake":e.add(i.Certificate.new_stake_registration(i.StakeRegistration.new(i.StakeCredential.from_keyhash(i.Ed25519KeyHash.from_hex(t.stakeKeyHash)))));break;case"DelegateStake":e.add(i.Certificate.new_stake_delegation(i.StakeDelegation.new(i.StakeCredential.from_keyhash(i.Ed25519KeyHash.from_hex(t.stakeKeyHash)),t.poolId.startsWith("pool")?i.Ed25519KeyHash.from_bech32(t.poolId):i.Ed25519KeyHash.from_hex(t.poolId))));break;case"DeregisterStake":e.add(i.Certificate.new_stake_deregistration(i.StakeDeregistration.new(i.StakeCredential.from_keyhash(i.Ed25519KeyHash.from_hex(t.stakeKeyHash)))));break;case"RetirePool":e.add(i.Certificate.new_pool_retirement(i.PoolRetirement.new(t.poolId.startsWith("pool")?i.Ed25519KeyHash.from_bech32(t.poolId):i.Ed25519KeyHash.from_hex(t.poolId),t.epoch)))}};queueAllLastItem=()=>{this.txOutput&&(this.meshTxBuilderBody.outputs.push(this.txOutput),this.txOutput=void 0),this.txInQueueItem&&this.queueInput(),this.collateralQueueItem&&(this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem),this.collateralQueueItem=void 0),this.mintItem&&this.queueMint()};addAllCertificates=e=>{const t=i.Certificates.new();e.forEach(r=>{this.addCertificate(t,r)}),this.txBuilder.set_certs(t)};addCostModels=()=>{this.txBuilder.calc_script_data_hash(i.TxBuilderConstants.plutus_vasil_cost_models())};addChange=e=>{this.txBuilder.add_change_if_needed(i.Address.from_bech32(e))};addValidityRange=({invalidBefore:e,invalidHereafter:t})=>{e&&this.txBuilder.set_validity_start_interval_bignum(i.BigNum.from_str(e.toString())),t&&this.txBuilder.set_ttl_bignum(i.BigNum.from_str(t.toString()))};addAllRequiredSignatures=e=>{e.forEach(t=>{this.txBuilder.add_required_signer(i.Ed25519KeyHash.from_hex(t))})};addAllMetadata=e=>{e.forEach(({tag:t,metadata:r})=>{this.txBuilder.add_json_metadatum(i.BigNum.from_str(t),zt.exports.stringify(r))})};updateRedeemer=(e,t)=>{t.forEach(r=>{switch(r.tag){case"SPEND":{const n=e.inputs[r.index];n.type=="Script"&&n.scriptTxIn.redeemer&&(n.scriptTxIn.redeemer.exUnits.mem=Math.floor(r.budget.mem*this.txEvaluationMultiplier),n.scriptTxIn.redeemer.exUnits.steps=Math.floor(r.budget.steps*this.txEvaluationMultiplier));break}case"MINT":{const n=e.mints[r.index];n.type=="Plutus"&&n.redeemer&&(n.redeemer.exUnits.mem=Math.floor(r.budget.mem*this.txEvaluationMultiplier),n.redeemer.exUnits.steps=Math.floor(r.budget.steps*this.txEvaluationMultiplier));break}}})};castRawDataToJsonString=e=>typeof e=="object"?zt.exports.stringify(e):e;castDataToPlutusData=({type:e,content:t})=>e==="Mesh"?Ot(t):e==="CBOR"?i.PlutusData.from_hex(t):i.PlutusData.from_json(t,i.PlutusDatumSchema.DetailedSchema)}class gn extends fn{_fetcher;_submitter;_evaluator;queriedTxHashes=new Set;queriedUTxOs={};constructor({fetcher:e,submitter:t,evaluator:r,isHydra:n=!1}){super(),e&&(this._fetcher=e),t&&(this._submitter=t),r&&(this._evaluator=r),n&&(this.isHydra=!0)}complete=async e=>{e?this.meshTxBuilderBody=e:this.queueAllLastItem();const{inputs:t,collaterals:r}=this.meshTxBuilderBody,n=[...t,...r].filter(a=>!this.isInputComplete(a));if(console.log("Incomplete UTxO",n),await this.queryAllTxInfo(n),console.log("Incomplete UTxO",n),n.forEach(a=>{this.completeTxInformation(a)}),this.completeSync(e),this._evaluator){const a=await this._evaluator.evaluateTx(this.txHex);this.updateRedeemer(this.meshTxBuilderBody,a),this.completeSync(e)}return this};submitTx=async e=>{var r;return await((r=this._submitter)==null?void 0:r.submitTx(e))};getUTxOInfo=async e=>{var r;let t=[];this.queriedTxHashes.has(e)||(console.log("Query",e),this.queriedTxHashes.add(e),t=await((r=this._fetcher)==null?void 0:r.fetchUTxOs(e))||[],this.queriedUTxOs[e]=t)};queryAllTxInfo=e=>{var r;const t=[];if(e.length>0&&!this._fetcher)throw Error("Transaction information is incomplete while no fetcher instance is provided");for(let n=0;n<e.length;n++){const a=e[n];this.isInputInfoComplete(a)||t.push(this.getUTxOInfo(a.txIn.txHash)),a.type==="Script"&&((r=a.scriptTxIn.scriptSource)==null?void 0:r.type)==="Inline"&&!this.isRefScriptInfoComplete(a)&&t.push(this.getUTxOInfo(a.scriptTxIn.scriptSource.txInInfo.txHash))}return Promise.all(t)};completeTxInformation=e=>{var t;if(!this.isInputInfoComplete(e)){const r=this.queriedUTxOs[e.txIn.txHash],n=r==null?void 0:r.find(l=>l.input.outputIndex===e.txIn.txIndex),a=n==null?void 0:n.output.amount,c=n==null?void 0:n.output.address;if(!a||a.length===0)throw Error(`Couldn't find value information for ${e.txIn.txHash}#${e.txIn.txIndex}`);if(e.txIn.amount=a,e.type==="PubKey"){if(!c||c==="")throw Error(`Couldn't find address information for ${e.txIn.txHash}#${e.txIn.txIndex}`);e.txIn.address=c}}if(e.type==="Script"&&((t=e.scriptTxIn.scriptSource)==null?void 0:t.type)=="Inline"&&!this.isRefScriptInfoComplete(e)){const r=e.scriptTxIn.scriptSource.txInInfo,a=this.queriedUTxOs[r.txHash].find(c=>c.input.outputIndex===r.txIndex);if(!a)throw Error(`Couldn't find script reference utxo for ${r.txHash}#${r.txIndex}`);r.spendingScriptHash=a==null?void 0:a.output.scriptHash}};isInputComplete=e=>e.type==="PubKey"?this.isInputInfoComplete(e):e.type==="Script"?this.isInputInfoComplete(e)&&this.isRefScriptInfoComplete(e):!0;isInputInfoComplete=e=>{const{amount:t,address:r}=e.txIn;return!(e.type==="PubKey"&&(!t||!r)||e.type==="Script"&&!t)};isRefScriptInfoComplete=e=>{var r;const{scriptSource:t}=e.scriptTxIn;return!((t==null?void 0:t.type)==="Inline"&&!((r=t.txInInfo)!=null&&r.spendingScriptHash))}}class st{_networkId;_encryptedSecret;constructor(e,t){this._networkId=e,this._encryptedSecret=t}getAccount(e,t){return this.accountContext(e,t,(r,n)=>{const a=hr(this._networkId,r.to_public().hash(),n.to_public().hash()).to_address().to_bech32(),c=dr(this._networkId,r.to_public().hash()).to_address().to_bech32(),l=Pe(this._networkId,n.to_public().hash()).to_address().to_bech32();return{baseAddress:a,enterpriseAddress:c,rewardAddress:l}})}signData(e,t,r,n){try{return this.accountContext(e,t,(a,c)=>{const l={payload:n},p={address:st.resolveAddress(this._networkId,r,a,c),key:r.startsWith("stake")?c:a},{coseSign1:A,coseKey:C}=ss(l,p);return{signature:A,key:C}})}catch(a){throw new Error(`An error occurred during signData: ${a}.`)}}signTx(e,t,r,n,a){try{const c=Dr(Kr(n));return this.accountContext(e,t,(l,p)=>{const A=i.Vkeywitnesses.new();return st.resolveSigners(n,r,l.to_public().hash().to_hex()).forEach(E=>{if(E===l.to_public().hash().to_hex())A.add(i.make_vkey_witness(c,l));else if(E===p.to_public().hash().to_hex())A.add(i.make_vkey_witness(c,p));else if(a===!1)throw new Error(`Missing key witness for: ${E}`)}),A})}catch(c){throw new Error(`An error occurred during signTx: ${c}.`)}}static encryptMnemonic(e,t){const r=De.mnemonicToEntropy(e.join(" ")),n=Or(r),a=ht(n.as_bytes());return n.free(),st.encrypt(a,t)}static encryptPrivateKey(e,t){const r=i.Bip32PrivateKey.from_bech32(e),n=ht(r.as_bytes());return r.free(),st.encrypt(n,t)}static encryptSigningKeys(e,t,r){const n=st.encrypt(e.slice(4),r),a=st.encrypt(t.slice(4),r);return[n,a]}static generateMnemonic(e=256){return De.generateMnemonic(e).split(" ")}accountContext(e,t,r){const{paymentKey:n,stakeKey:a}=st.resolveKeys(e,t,this._encryptedSecret),c=r(n,a);return n.free(),a.free(),c}static decrypt(e,t){try{return i.decrypt_with_password(ct(t),e)}catch{throw new Error("The password is incorrect.")}}static encrypt(e,t){const r=mr.customAlphabet("0123456789abcdef"),n=r(64),a=r(24);return i.encrypt_with_password(ct(t),n,a,e)}static resolveAddress(e,t,r,n){const a=[hr(e,r.to_public().hash(),n.to_public().hash()),dr(e,r.to_public().hash()),Pe(e,n.to_public().hash())].find(c=>c.to_address().to_bech32()===t);if(a!==void 0)return a.to_address();throw new Error(`Address: ${t} doesn't belong to this account.`)}static resolveKeys(e,t,r){if(typeof r=="string"){const c=st.decrypt(r,t);return Qs(c,e)}const n=st.decrypt(r[0],t),a=st.decrypt(r[1],t);return{paymentKey:i.PrivateKey.from_hex(n),stakeKey:i.PrivateKey.from_hex(a)}}static resolveSigners(e,t,r){const n=l=>{const p=(T,Q=[],R=0)=>{var O,M,W,Z,D;if(T===void 0||R>=T.len())return Q;const X=T.get(R),$=new Array;switch(X.kind()){case i.CertificateKind.StakeDeregistration:{const F=(O=X.as_stake_deregistration())==null?void 0:O.stake_credential(),q=(F==null?void 0:F.kind())===i.StakeCredKind.Key?F.to_keyhash():void 0;q&&$.push(q.to_hex());break}case i.CertificateKind.StakeDelegation:{const F=(M=X.as_stake_delegation())==null?void 0:M.stake_credential(),q=(F==null?void 0:F.kind())===i.StakeCredKind.Key?F.to_keyhash():void 0;q&&$.push(q.to_hex());break}case i.CertificateKind.PoolRegistration:{const F=(W=X.as_pool_registration())==null?void 0:W.pool_params().pool_owners();$.push(...C(F));break}case i.CertificateKind.PoolRetirement:{const F=(Z=X.as_pool_retirement())==null?void 0:Z.pool_keyhash();F&&$.push(F.to_hex());break}case i.CertificateKind.MoveInstantaneousRewardsCert:{const F=(D=X.as_move_instantaneous_rewards_cert())==null?void 0:D.move_instantaneous_reward().as_to_stake_creds();if(F)for(let q=0;q<F.len();q+=1){const J=F.keys().get(q),nt=J.kind()===i.StakeCredKind.Key?J.to_keyhash():void 0;nt&&$.push(nt.to_hex())}break}}return p(T,[...Q,...$],R+1)},A=(T,Q=[],R=0)=>{if(T===void 0||R>=T.len())return Q;const X=T.get(R).index(),$=T.get(R).transaction_id(),O=t.find(M=>M.input.outputIndex===X&&M.input.txHash===$.to_hex())!==void 0?r:"OUR_PRINCESS_IS_IN_ANOTHER_CASTLE";return A(T,[...Q,O],R+1)},C=(T,Q=[],R=0)=>T===void 0||R>=T.len()?Q:C(T,[...Q,T.get(R).to_hex()],R+1),E=(T,Q=[],R=0)=>{if(T===void 0||R>=T.len())return Q;const X=T.keys().get(R).payment_cred(),$=X.kind()===i.StakeCredKind.Key?X.to_keyhash():void 0;return E(T,$?[...Q,$.to_hex()]:Q,R+1)},w=l.certs(),b=l.collateral(),P=l.inputs(),k=l.required_signers(),N=l.withdrawals();return[...p(w),...A(b),...A(P),...C(k),...E(N)]},a=l=>{const p=(C,E=[])=>{var w,b,P,k;if(C)for(let N=0;N<C.len();N+=1){const T=C.get(N);switch(T.kind()){case i.NativeScriptKind.ScriptPubkey:{const Q=(w=T.as_script_pubkey())==null?void 0:w.addr_keyhash().to_hex();return Q?[...E,Q]:E}case i.NativeScriptKind.ScriptAll:return p((b=T.as_script_all())==null?void 0:b.native_scripts(),E);case i.NativeScriptKind.ScriptAny:return p((P=T.as_script_any())==null?void 0:P.native_scripts(),E);case i.NativeScriptKind.ScriptNOfK:return p((k=T.as_script_n_of_k())==null?void 0:k.native_scripts(),E)}}return E},A=l.native_scripts();return[...p(A)]},c=It(e);return new Set([...n(c.body()),...a(c.witness_set())])}}const pt="MARI0TIME";class mn{_fetcher;_submitter;_wallet;constructor(e){switch(this._fetcher=e.fetcher,this._submitter=e.submitter,e.key.type){case"mnemonic":this._wallet=new st(e.networkId,st.encryptMnemonic(e.key.words,pt));break;case"root":this._wallet=new st(e.networkId,st.encryptPrivateKey(e.key.bech32,pt));break;case"cli":this._wallet=new st(e.networkId,st.encryptSigningKeys(e.key.payment,e.key.stake??"f0".repeat(34),pt))}}getBaseAddress(e=0){return this._wallet.getAccount(e,pt).baseAddress}getPaymentAddress(e=0){return this._wallet.getAccount(e,pt).enterpriseAddress}getRewardAddress(e=0){return this._wallet.getAccount(e,pt).rewardAddress}getUsedAddress(e=0){const t=this._wallet.getAccount(e,pt);return _t(t.enterpriseAddress)}getUsedCollateral(e=gt.maxCollateralInputs){throw new Error("getUsedCollateral not implemented.")}async getUsedUTxOs(e=0){const t=this._wallet.getAccount(e,pt);return(await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map(n=>wt(n))}signData(e,t,r=0){try{return this._wallet.signData(r,pt,e,t)}catch(n){throw new Error(`[AppWallet] An error occurred during signData: ${n}.`)}}async signTx(e,t=!1,r=0){try{const n=this._wallet.getAccount(r,pt),a=await this._fetcher.fetchAddressUTxOs(n.enterpriseAddress),c=this._wallet.signTx(r,pt,a,e,t),l=It(e),p=l.witness_set(),A=Oe(p,c);return p.set_vkeys(A),i.Transaction.new(l.body(),p,l.auxiliary_data()).to_hex()}catch(n){throw new Error(`[AppWallet] An error occurred during signTx: ${n}.`)}}async signTxs(e,t){return console.log("unimplemented",e,t),[]}submitTx(e){return this._submitter.submitTx(e)}static brew(e=256){return st.generateMnemonic(e)}}class Ie{_walletInstance;_walletName;walletInstance;constructor(e,t){this._walletInstance=e,this._walletName=t,this.walletInstance={...e}}static getInstalledWallets(){return window.cardano===void 0?[]:$e.filter(e=>window.cardano[e]!==void 0).map(e=>({name:window.cardano[e].name,icon:window.cardano[e].icon,version:window.cardano[e].apiVersion}))}static async enable(e){try{const t=await Ie.resolveInstance(e);if(t!==void 0)return new Ie(t,e);throw new Error(`Couldn't create an instance of wallet: ${e}`)}catch(t){throw new Error(`[BrowserWallet] An error occurred during enable: ${JSON.stringify(t)}.`)}}async getBalance(){const e=await this._walletInstance.getBalance();return Ur(Os(e))}async getChangeAddress(){const e=await this._walletInstance.getChangeAddress();return Lt(e).to_bech32()}async getCollateral(e=gt.maxCollateralInputs){return(await this.getUsedCollateral(e)).map(r=>pe(r))}getNetworkId(){return this._walletInstance.getNetworkId()}async getRewardAddresses(){return(await this._walletInstance.getRewardAddresses()).map(t=>Lt(t).to_bech32())}async getUnusedAddresses(){return(await this._walletInstance.getUnusedAddresses()).map(t=>Lt(t).to_bech32())}async getUsedAddresses(){return(await this._walletInstance.getUsedAddresses()).map(t=>Lt(t).to_bech32())}async getUtxos(e=void 0){return(await this.getUsedUTxOs(e)).map(r=>pe(r))}signData(e,t){const r=_t(e).to_hex();return this._walletInstance.signData(r,ct(t))}async signTx(e,t=!1){try{const r=It(e),n=r.witness_set(),a=await this._walletInstance.signTx(e,t),c=ur(a).vkeys()??i.Vkeywitnesses.new(),l=Oe(n,c);return n.set_vkeys(l),ht(i.Transaction.new(r.body(),n,r.auxiliary_data()).to_bytes())}catch(r){throw new Error(`[BrowserWallet] An error occurred during signTx: ${JSON.stringify(r)}.`)}}async signTxs(e,t=!1){let r;switch(this._walletName){case"Typhon Wallet":this._walletInstance.signTxs&&(r=await this._walletInstance.signTxs(e,t));break;default:this._walletInstance.signTxs?r=await this._walletInstance.signTxs(e.map(a=>({cbor:a,partialSign:t}))):this._walletInstance.experimental.signTxs&&(r=await this._walletInstance.experimental.signTxs(e.map(a=>({cbor:a,partialSign:t}))));break}if(!r)throw new Error("Wallet does not support signTxs");const n=[];for(let a=0;a<r.length;a++){const c=It(e[a]),l=c.witness_set(),p=ur(r[a]).vkeys()??i.Vkeywitnesses.new(),A=Oe(l,p);l.set_vkeys(A);const C=ht(i.Transaction.new(c.body(),l,c.auxiliary_data()).to_bytes());n.push(C)}return n}submitTx(e){return this._walletInstance.submitTx(e)}async getUsedAddress(){const e=await this._walletInstance.getUsedAddresses();return Lt(e[0])}async getUsedCollateral(e=gt.maxCollateralInputs){return(await this._walletInstance.experimental.getCollateral()??[]).map(r=>cr(r)).slice(0,e)}async getUsedUTxOs(e=void 0){const t=e?Qt(e).to_hex():void 0;return(await this._walletInstance.getUtxos(t)??[]).map(n=>cr(n))}async getAssets(){return(await this.getBalance()).filter(t=>t.unit!=="lovelace").map(t=>{const r=t.unit.slice(0,Bt),n=t.unit.slice(Bt),a=Mr(r,n);return{unit:t.unit,policyId:r,assetName:qe(n),fingerprint:a,quantity:t.quantity}})}async getLovelace(){const t=(await this.getBalance()).find(r=>r.unit==="lovelace");return t!==void 0?t.quantity:"0"}async getPolicyIdAssets(e){return(await this.getAssets()).filter(r=>r.policyId===e)}async getPolicyIds(){const e=await this.getBalance();return Array.from(new Set(e.map(t=>t.unit.slice(0,Bt)))).filter(t=>t!=="lovelace")}static resolveInstance(e){if(window.cardano===void 0)return;const t=$e.map(r=>window.cardano[r]).filter(r=>r!==void 0).find(r=>r.name.toLowerCase()===e.toLowerCase());return t==null?void 0:t.enable()}}exports.AppWallet=mn;exports.BlockfrostProvider=Xs;exports.BrowserWallet=Ie;exports.EmbeddedWallet=st;exports.ForgeScript=nn;exports.InfuraProvider=Zs;exports.KoiosProvider=tn;exports.MaestroProvider=sn;exports.MeshTxBuilder=gn;exports.OgmiosProvider=en;exports.TangoProvider=rn;exports.checkSignature=ns;exports.generateNonce=Ws;exports.isNetwork=Ar;exports.keepRelevant=pr;exports.largestFirst=Jr;exports.largestFirstMultiAsset=Ir;exports.parseAssetUnit=kt;exports.parseHttpError=S;exports.readPlutusData=js;exports.readTransaction=Js;exports.resolveDataHash=Hs;exports.resolveEpochNo=Fs;exports.resolveFingerprint=Mr;exports.resolveLanguageView=Rs;exports.resolveNativeScriptHash=qs;exports.resolvePaymentKeyHash=qt;exports.resolvePlutusScriptAddress=Vs;exports.resolvePlutusScriptHash=Ls;exports.resolvePoolId=Gs;exports.resolvePrivateKey=Ys;exports.resolveRewardAddress=ie;exports.resolveScriptRef=$s;exports.resolveSlotNo=zs;exports.resolveStakeKeyHash=Yt;exports.resolveTxFees=Ve;exports.resolveTxHash=Kr;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $n=require("nanoid"),Ha=require("axios"),tn=require("bip39"),jt=require("@emurgo/cardano-message-signing-nodejs"),qa=c=>c&&typeof c=="object"&&"default"in c?c:{default:c},ze=qa(Ha),Ra=(c,i)=>({alternative:c,fields:i}),wr=c=>({alternative:0,fields:c}),Jn=c=>({alternative:1,fields:c}),La=c=>({alternative:2,fields:c}),wn=c=>c===""?Jn([]):wr([wr([wr([c])])]),za=(c,i)=>wr([{alternative:0,fields:[c]},wn(i||"")]),Va=(c,i)=>wr([{alternative:1,fields:[c]},wn(i||"")]),$r=(c,i)=>({constructor:c,fields:i}),m_=c=>$r(0,c),Jr=c=>$r(1,c),Ga=c=>$r(2,c),Ya=c=>c?Jr([]):m_([]),Oe=c=>({bytes:c}),ln=c=>({int:c}),$a=c=>({list:c}),gn=c=>Oe(c),un=c=>Oe(c),bn=c=>c===""?Jr([]):m_([m_([m_([Oe(c)])])]),Ja=(c,i)=>m_([m_([Oe(c)]),bn(i||"")]),Wa=(c,i)=>m_([Jr([Oe(c)]),bn(i||"")]),Xa=(c,i)=>m_([gn(c),un(i)]),Za=(c,i)=>m_([m_([Oe(c)]),ln(i)]),ts=c=>Oe(c),_s=c=>Oe(c),es=c=>({int:c}),_n=c=>({map:c.map(([i,t])=>({k:i,v:t}))}),rs=c=>({map:c.map(([i,t])=>({k:i,v:t}))}),ns=(c,i)=>m_([c,i]),as=c=>{const i=[],t={};return c.forEach(w=>{const u=w.unit.replace("lovelace",""),h=u.slice(0,56)||"",k=u.slice(56)||"";t[h]||(t[h]={}),t[h][k]?t[h][k]+=Number(w.quantity):t[h][k]=Number(w.quantity)}),Object.keys(t).forEach(w=>{const u=gn(w),h=Object.keys(t[w]).map(j=>[un(j),ln(t[w][j])]),k=_n(h);i.push([u,k])}),_n(i)},ss=c=>{const i=[];return c.map.forEach(t=>{const w=t.k.bytes;t.v.map.forEach(u=>{const h=u.k.bytes,k=u.v.int.toString(),j=w+h,P=j===""?"lovelace":j;i.push({unit:P,quantity:k})})}),i};var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(c){var i=c.default;if(typeof i=="function"){var t=function(){return i.apply(this,arguments)};t.prototype=i.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(c).forEach(function(w){var u=Object.getOwnPropertyDescriptor(c,w);Object.defineProperty(t,w,u.get?u:{enumerable:!0,get:function(){return c[w]}})}),t}function en(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var y={exports:{}},Wn={},is=function(i){return i&&typeof i=="object"&&typeof i.copy=="function"&&typeof i.fill=="function"&&typeof i.readUInt8=="function"},rn={exports:{}};typeof Object.create=="function"?rn.exports=function(i,t){i.super_=t,i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}})}:rn.exports=function(i,t){i.super_=t;var w=function(){};w.prototype=t.prototype,i.prototype=new w,i.prototype.constructor=i};(function(c){var i=Object.getOwnPropertyDescriptors||function(q){for(var z=Object.keys(q),I={},wt=0;wt<z.length;wt++)I[z[wt]]=Object.getOwnPropertyDescriptor(q,z[wt]);return I},t=/%[sdj%]/g;c.format=function(K){if(!ft(K)){for(var q=[],z=0;z<arguments.length;z++)q.push(h(arguments[z]));return q.join(" ")}for(var z=1,I=arguments,wt=I.length,bt=String(K).replace(t,function(et){if(et==="%%")return"%";if(z>=wt)return et;switch(et){case"%s":return String(I[z++]);case"%d":return Number(I[z++]);case"%j":try{return JSON.stringify(I[z++])}catch{return"[Circular]"}default:return et}}),st=I[z];z<wt;st=I[++z])W(st)||!D(st)?bt+=" "+st:bt+=" "+h(st);return bt},c.deprecate=function(K,q){if(typeof process<"u"&&process.noDeprecation===!0)return K;if(typeof process>"u")return function(){return c.deprecate(K,q).apply(this,arguments)};var z=!1;function I(){if(!z){if(process.throwDeprecation)throw new Error(q);process.traceDeprecation?console.trace(q):console.error(q),z=!0}return K.apply(this,arguments)}return I};var w={},u;c.debuglog=function(K){if(Z(u)&&(u=process.env.NODE_DEBUG||""),K=K.toUpperCase(),!w[K])if(new RegExp("\\b"+K+"\\b","i").test(u)){var q=process.pid;w[K]=function(){var z=c.format.apply(c,arguments);console.error("%s %d: %s",K,q,z)}}else w[K]=function(){};return w[K]};function h(K,q){var z={seen:[],stylize:j};return arguments.length>=3&&(z.depth=arguments[2]),arguments.length>=4&&(z.colors=arguments[3]),_t(q)?z.showHidden=q:q&&c._extend(z,q),Z(z.showHidden)&&(z.showHidden=!1),Z(z.depth)&&(z.depth=2),Z(z.colors)&&(z.colors=!1),Z(z.customInspect)&&(z.customInspect=!0),z.colors&&(z.stylize=k),p(z,K,z.depth)}c.inspect=h,h.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function k(K,q){var z=h.styles[q];return z?"\x1B["+h.colors[z][0]+"m"+K+"\x1B["+h.colors[z][1]+"m":K}function j(K,q){return K}function P(K){var q={};return K.forEach(function(z,I){q[z]=!0}),q}function p(K,q,z){if(K.customInspect&&q&&ct(q.inspect)&&q.inspect!==c.inspect&&!(q.constructor&&q.constructor.prototype===q)){var I=q.inspect(z,K);return ft(I)||(I=p(K,I,z)),I}var wt=V(K,q);if(wt)return wt;var bt=Object.keys(q),st=P(bt);if(K.showHidden&&(bt=Object.getOwnPropertyNames(q)),J(q)&&(bt.indexOf("message")>=0||bt.indexOf("description")>=0))return G(q);if(bt.length===0){if(ct(q)){var et=q.name?": "+q.name:"";return K.stylize("[Function"+et+"]","special")}if(g(q))return K.stylize(RegExp.prototype.toString.call(q),"regexp");if(Q(q))return K.stylize(Date.prototype.toString.call(q),"date");if(J(q))return G(q)}var ot="",x=!1,A=["{","}"];if(b(q)&&(x=!0,A=["[","]"]),ct(q)){var B=q.name?": "+q.name:"";ot=" [Function"+B+"]"}if(g(q)&&(ot=" "+RegExp.prototype.toString.call(q)),Q(q)&&(ot=" "+Date.prototype.toUTCString.call(q)),J(q)&&(ot=" "+G(q)),bt.length===0&&(!x||q.length==0))return A[0]+ot+A[1];if(z<0)return g(q)?K.stylize(RegExp.prototype.toString.call(q),"regexp"):K.stylize("[Object]","special");K.seen.push(q);var N;return x?N=R(K,q,z,st,bt):N=bt.map(function(S){return m(K,q,z,st,S,x)}),K.seen.pop(),$(N,ot,A)}function V(K,q){if(Z(q))return K.stylize("undefined","undefined");if(ft(q)){var z="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return K.stylize(z,"string")}if(nt(q))return K.stylize(""+q,"number");if(_t(q))return K.stylize(""+q,"boolean");if(W(q))return K.stylize("null","null")}function G(K){return"["+Error.prototype.toString.call(K)+"]"}function R(K,q,z,I,wt){for(var bt=[],st=0,et=q.length;st<et;++st)Ut(q,String(st))?bt.push(m(K,q,z,I,String(st),!0)):bt.push("");return wt.forEach(function(ot){ot.match(/^\d+$/)||bt.push(m(K,q,z,I,ot,!0))}),bt}function m(K,q,z,I,wt,bt){var st,et,ot;if(ot=Object.getOwnPropertyDescriptor(q,wt)||{value:q[wt]},ot.get?ot.set?et=K.stylize("[Getter/Setter]","special"):et=K.stylize("[Getter]","special"):ot.set&&(et=K.stylize("[Setter]","special")),Ut(I,wt)||(st="["+wt+"]"),et||(K.seen.indexOf(ot.value)<0?(W(z)?et=p(K,ot.value,null):et=p(K,ot.value,z-1),et.indexOf(`
|
|
2
|
+
`)>-1&&(bt?et=et.split(`
|
|
3
|
+
`).map(function(x){return" "+x}).join(`
|
|
4
|
+
`).substr(2):et=`
|
|
5
|
+
`+et.split(`
|
|
6
|
+
`).map(function(x){return" "+x}).join(`
|
|
7
|
+
`))):et=K.stylize("[Circular]","special")),Z(st)){if(bt&&wt.match(/^\d+$/))return et;st=JSON.stringify(""+wt),st.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(st=st.substr(1,st.length-2),st=K.stylize(st,"name")):(st=st.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),st=K.stylize(st,"string"))}return st+": "+et}function $(K,q,z){var I=K.reduce(function(wt,bt){return bt.indexOf(`
|
|
8
|
+
`)>=0,wt+bt.replace(/\u001b\[\d\d?m/g,"").length+1},0);return I>60?z[0]+(q===""?"":q+`
|
|
9
|
+
`)+" "+K.join(`,
|
|
10
|
+
`)+" "+z[1]:z[0]+q+" "+K.join(", ")+" "+z[1]}function b(K){return Array.isArray(K)}c.isArray=b;function _t(K){return typeof K=="boolean"}c.isBoolean=_t;function W(K){return K===null}c.isNull=W;function v(K){return K==null}c.isNullOrUndefined=v;function nt(K){return typeof K=="number"}c.isNumber=nt;function ft(K){return typeof K=="string"}c.isString=ft;function a(K){return typeof K=="symbol"}c.isSymbol=a;function Z(K){return K===void 0}c.isUndefined=Z;function g(K){return D(K)&&xt(K)==="[object RegExp]"}c.isRegExp=g;function D(K){return typeof K=="object"&&K!==null}c.isObject=D;function Q(K){return D(K)&&xt(K)==="[object Date]"}c.isDate=Q;function J(K){return D(K)&&(xt(K)==="[object Error]"||K instanceof Error)}c.isError=J;function ct(K){return typeof K=="function"}c.isFunction=ct;function ut(K){return K===null||typeof K=="boolean"||typeof K=="number"||typeof K=="string"||typeof K=="symbol"||typeof K>"u"}c.isPrimitive=ut,c.isBuffer=is;function xt(K){return Object.prototype.toString.call(K)}function At(K){return K<10?"0"+K.toString(10):K.toString(10)}var pt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function It(){var K=new Date,q=[At(K.getHours()),At(K.getMinutes()),At(K.getSeconds())].join(":");return[K.getDate(),pt[K.getMonth()],q].join(" ")}c.log=function(){console.log("%s - %s",It(),c.format.apply(c,arguments))},c.inherits=rn.exports,c._extend=function(K,q){if(!q||!D(q))return K;for(var z=Object.keys(q),I=z.length;I--;)K[z[I]]=q[z[I]];return K};function Ut(K,q){return Object.prototype.hasOwnProperty.call(K,q)}var Dt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;c.promisify=function(q){if(typeof q!="function")throw new TypeError('The "original" argument must be of type Function');if(Dt&&q[Dt]){var z=q[Dt];if(typeof z!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(z,Dt,{value:z,enumerable:!1,writable:!1,configurable:!0}),z}function z(){for(var I,wt,bt=new Promise(function(ot,x){I=ot,wt=x}),st=[],et=0;et<arguments.length;et++)st.push(arguments[et]);st.push(function(ot,x){ot?wt(ot):I(x)});try{q.apply(this,st)}catch(ot){wt(ot)}return bt}return Object.setPrototypeOf(z,Object.getPrototypeOf(q)),Dt&&Object.defineProperty(z,Dt,{value:z,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(z,i(q))},c.promisify.custom=Dt;function Pt(K,q){if(!K){var z=new Error("Promise was rejected with a falsy value");z.reason=K,K=z}return q(K)}function qt(K){if(typeof K!="function")throw new TypeError('The "original" argument must be of type Function');function q(){for(var z=[],I=0;I<arguments.length;I++)z.push(arguments[I]);var wt=z.pop();if(typeof wt!="function")throw new TypeError("The last argument must be of type Function");var bt=this,st=function(){return wt.apply(bt,arguments)};K.apply(this,z).then(function(et){process.nextTick(st,null,et)},function(et){process.nextTick(Pt,et,st)})}return Object.setPrototypeOf(q,Object.getPrototypeOf(K)),Object.defineProperties(q,i(K)),q}c.callbackify=qt})(Wn);const ds={},cs=Object.freeze(Object.defineProperty({__proto__:null,default:ds},Symbol.toStringTag,{value:"Module"})),jn=os(cs);(function(c){let i={};i.__wbindgen_placeholder__=c.exports;let t;const{TextDecoder:w,TextEncoder:u}=Wn,h=new Array(128).fill(void 0);h.push(void 0,null,!0,!1);function k(C){return h[C]}let j=h.length;function P(C){C<132||(h[C]=j,j=C)}function p(C){const _=k(C);return P(C),_}let V=new w("utf-8",{ignoreBOM:!0,fatal:!0});V.decode();let G=null;function R(){return(G===null||G.byteLength===0)&&(G=new Uint8Array(t.memory.buffer)),G}function m(C,_){return C=C>>>0,V.decode(R().subarray(C,C+_))}function $(C){j===h.length&&h.push(h.length+1);const _=j;return j=h[_],h[_]=C,_}let b=0,_t=new u("utf-8");const W=typeof _t.encodeInto=="function"?function(C,_){return _t.encodeInto(C,_)}:function(C,_){const e=_t.encode(C);return _.set(e),{read:C.length,written:e.length}};function v(C,_,e){if(e===void 0){const o=_t.encode(C),f=_(o.length,1)>>>0;return R().subarray(f,f+o.length).set(o),b=o.length,f}let s=C.length,n=_(s,1)>>>0;const r=R();let d=0;for(;d<s;d++){const o=C.charCodeAt(d);if(o>127)break;r[n+d]=o}if(d!==s){d!==0&&(C=C.slice(d)),n=e(n,s,s=d+C.length*3,1)>>>0;const o=R().subarray(n+d,n+s),f=W(C,o);d+=f.written}return b=d,n}function nt(C){return C==null}let ft=null;function a(){return(ft===null||ft.byteLength===0)&&(ft=new Int32Array(t.memory.buffer)),ft}function Z(C){const _=typeof C;if(_=="number"||_=="boolean"||C==null)return`${C}`;if(_=="string")return`"${C}"`;if(_=="symbol"){const n=C.description;return n==null?"Symbol":`Symbol(${n})`}if(_=="function"){const n=C.name;return typeof n=="string"&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(C)){const n=C.length;let r="[";n>0&&(r+=Z(C[0]));for(let d=1;d<n;d++)r+=", "+Z(C[d]);return r+="]",r}const e=/\[object ([^\]]+)\]/.exec(toString.call(C));let s;if(e.length>1)s=e[1];else return toString.call(C);if(s=="Object")try{return"Object("+JSON.stringify(C)+")"}catch{return"Object"}return C instanceof Error?`${C.name}: ${C.message}
|
|
11
|
+
${C.stack}`:s}c.exports.script_to_address=function(C,_,e){let s,n;try{const l=t.__wbindgen_add_to_stack_pointer(-16),H=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),rt=b;var r=nt(e)?0:v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),d=b;t.script_to_address(l,C,H,rt,r,d);var o=a()[l/4+0],f=a()[l/4+1];return s=o,n=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(s,n,1)}},c.exports.serialize_bech32_address=function(C){const _=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),e=b,s=t.serialize_bech32_address(_,e);return vr.__wrap(s)};function g(C,_){if(!(C instanceof _))throw new Error(`expected instance of ${_.name}`);return C.ptr}c.exports.apply_params_to_script=function(C,_){let e,s;try{const rt=t.__wbindgen_add_to_stack_pointer(-16);g(C,rr);var n=C.__destroy_into_raw();const dt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),Xe=b;t.apply_params_to_script(rt,n,dt,Xe);var r=a()[rt/4+0],d=a()[rt/4+1],o=a()[rt/4+2],f=a()[rt/4+3],l=r,H=d;if(f)throw l=0,H=0,p(o);return e=l,s=H,m(l,H)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}},c.exports.get_v2_script_hash=function(C){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.get_v2_script_hash(r,d,o);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}},c.exports.calculate_tx_hash=function(C){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.calculate_tx_hash(r,d,o);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}},c.exports.sign_transaction=function(C,_){let e,s;try{const o=t.__wbindgen_add_to_stack_pointer(-16),f=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),l=b;g(_,rr);var n=_.__destroy_into_raw();t.sign_transaction(o,f,l,n);var r=a()[o/4+0],d=a()[o/4+1];return e=r,s=d,m(r,d)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}};function D(C,_){return C=C>>>0,R().subarray(C/1,C/1+_)}function Q(C,_){const e=_(C.length*1,1)>>>0;return R().set(C,e/1),b=C.length,e}c.exports.encrypt_with_password=function(C,_,e,s){let n,r;try{const dt=t.__wbindgen_add_to_stack_pointer(-16),Xe=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),mr=b,Na=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),Ua=b,Pa=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),Ma=b,Fa=v(s,t.__wbindgen_malloc,t.__wbindgen_realloc),Ka=b;t.encrypt_with_password(dt,Xe,mr,Na,Ua,Pa,Ma,Fa,Ka);var d=a()[dt/4+0],o=a()[dt/4+1],f=a()[dt/4+2],l=a()[dt/4+3],H=d,rt=o;if(l)throw H=0,rt=0,p(f);return n=H,r=rt,m(H,rt)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(n,r,1)}},c.exports.decrypt_with_password=function(C,_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b,Xe=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),mr=b;t.decrypt_with_password(H,rt,dt,Xe,mr);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}},c.exports.min_fee=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(C,f_),g(_,ar),t.min_fee(r,C.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.calculate_ex_units_ceil_cost=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(C,at),g(_,vt),t.calculate_ex_units_ceil_cost(r,C.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.min_script_fee=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(C,f_),g(_,vt),t.min_script_fee(r,C.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.encode_arbitrary_bytes_as_metadatum=function(C){const _=Q(C,t.__wbindgen_malloc),e=b,s=t.encode_arbitrary_bytes_as_metadatum(_,e);return mt.__wrap(s)},c.exports.decode_arbitrary_bytes_from_metadatum=function(C){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(C,mt),t.decode_arbitrary_bytes_from_metadatum(d,C.__wbg_ptr);var _=a()[d/4+0],e=a()[d/4+1],s=a()[d/4+2],n=a()[d/4+3];if(n)throw p(s);var r=D(_,e).slice();return t.__wbindgen_free(_,e*1),r}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.encode_json_str_to_metadatum=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.encode_json_str_to_metadatum(r,d,o,_);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.decode_metadatum_to_json_str=function(C,_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16);g(C,mt),t.decode_metadatum_to_json_str(H,C.__wbg_ptr,_);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}},c.exports.encode_json_str_to_plutus_datum=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.encode_json_str_to_plutus_datum(r,d,o,_);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.decode_plutus_datum_to_json_str=function(C,_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16);g(C,yt),t.decode_plutus_datum_to_json_str(H,C.__wbg_ptr,_);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}},c.exports.create_send_all=function(C,_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(C,pt),g(_,We),g(e,ir),t.create_send_all(d,C.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return Dr.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}};let J=null;function ct(){return(J===null||J.byteLength===0)&&(J=new Uint32Array(t.memory.buffer)),J}function ut(C,_){return C=C>>>0,ct().subarray(C/4,C/4+_)}c.exports.make_daedalus_bootstrap_witness=function(C,_,e){g(C,h_),g(_,A),g(e,hr);const s=t.make_daedalus_bootstrap_witness(C.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return ot.__wrap(s)},c.exports.make_icarus_bootstrap_witness=function(C,_,e){g(C,h_),g(_,A),g(e,wt);const s=t.make_icarus_bootstrap_witness(C.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return ot.__wrap(s)},c.exports.make_vkey_witness=function(C,_){g(C,h_),g(_,A_);const e=t.make_vkey_witness(C.__wbg_ptr,_.__wbg_ptr);return R_.__wrap(e)},c.exports.hash_auxiliary_data=function(C){g(C,Pt);const _=t.hash_auxiliary_data(C.__wbg_ptr);return qt.__wrap(_)},c.exports.hash_transaction=function(C){g(C,Wt);const _=t.hash_transaction(C.__wbg_ptr);return h_.__wrap(_)},c.exports.hash_plutus_data=function(C){g(C,yt);const _=t.hash_plutus_data(C.__wbg_ptr);return U.__wrap(_)},c.exports.hash_script_data=function(C,_,e){g(C,I_),g(_,M);let s=0;nt(e)||(g(e,a_),s=e.__destroy_into_raw());const n=t.hash_script_data(C.__wbg_ptr,_.__wbg_ptr,s);return M_.__wrap(n)},c.exports.get_implicit_input=function(C,_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(C,Wt),g(_,I),g(e,I),t.get_implicit_input(d,C.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return gt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.get_deposit=function(C,_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(C,Wt),g(_,I),g(e,I),t.get_deposit(d,C.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return I.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.min_ada_for_output=function(C,_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(C,Yt),g(_,F),t.min_ada_for_output(r,C.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.min_ada_required=function(C,_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(C,gt),g(e,I),t.min_ada_required(d,C.__wbg_ptr,_,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return I.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}},c.exports.encode_json_str_to_native_script=function(C,_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=v(C,t.__wbindgen_malloc,t.__wbindgen_realloc),f=b,l=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),H=b;t.encode_json_str_to_native_script(d,o,f,l,H,e);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return Nt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}};function xt(C,_){const e=_(C.length*4,4)>>>0;return ct().set(C,e/4),b=C.length,e}function At(C,_){try{return C.apply(this,_)}catch(e){t.__wbindgen_exn_store($(e))}}c.exports.StakeCredKind=Object.freeze({Key:0,0:"Key",Script:1,1:"Script"}),c.exports.TransactionMetadatumKind=Object.freeze({MetadataMap:0,0:"MetadataMap",MetadataList:1,1:"MetadataList",Int:2,2:"Int",Bytes:3,3:"Bytes",Text:4,4:"Text"}),c.exports.MetadataJsonSchema=Object.freeze({NoConversions:0,0:"NoConversions",BasicConversions:1,1:"BasicConversions",DetailedSchema:2,2:"DetailedSchema"}),c.exports.LanguageKind=Object.freeze({PlutusV1:0,0:"PlutusV1",PlutusV2:1,1:"PlutusV2"}),c.exports.PlutusDataKind=Object.freeze({ConstrPlutusData:0,0:"ConstrPlutusData",Map:1,1:"Map",List:2,2:"List",Integer:3,3:"Integer",Bytes:4,4:"Bytes"}),c.exports.RedeemerTagKind=Object.freeze({Spend:0,0:"Spend",Mint:1,1:"Mint",Cert:2,2:"Cert",Reward:3,3:"Reward"}),c.exports.PlutusDatumSchema=Object.freeze({BasicConversions:0,0:"BasicConversions",DetailedSchema:1,1:"DetailedSchema"}),c.exports.CoinSelectionStrategyCIP2=Object.freeze({LargestFirst:0,0:"LargestFirst",RandomImprove:1,1:"RandomImprove",LargestFirstMultiAsset:2,2:"LargestFirstMultiAsset",RandomImproveMultiAsset:3,3:"RandomImproveMultiAsset"}),c.exports.CborContainerType=Object.freeze({Array:0,0:"Array",Map:1,1:"Map"}),c.exports.ScriptSchema=Object.freeze({Wallet:0,0:"Wallet",Node:1,1:"Node"}),c.exports.CertificateKind=Object.freeze({StakeRegistration:0,0:"StakeRegistration",StakeDeregistration:1,1:"StakeDeregistration",StakeDelegation:2,2:"StakeDelegation",PoolRegistration:3,3:"PoolRegistration",PoolRetirement:4,4:"PoolRetirement",GenesisKeyDelegation:5,5:"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,6:"MoveInstantaneousRewardsCert"}),c.exports.MIRPot=Object.freeze({Reserves:0,0:"Reserves",Treasury:1,1:"Treasury"}),c.exports.MIRKind=Object.freeze({ToOtherPot:0,0:"ToOtherPot",ToStakeCredentials:1,1:"ToStakeCredentials"}),c.exports.RelayKind=Object.freeze({SingleHostAddr:0,0:"SingleHostAddr",SingleHostName:1,1:"SingleHostName",MultiHostName:2,2:"MultiHostName"}),c.exports.NativeScriptKind=Object.freeze({ScriptPubkey:0,0:"ScriptPubkey",ScriptAll:1,1:"ScriptAll",ScriptAny:2,2:"ScriptAny",ScriptNOfK:3,3:"ScriptNOfK",TimelockStart:4,4:"TimelockStart",TimelockExpiry:5,5:"TimelockExpiry"}),c.exports.ScriptHashNamespace=Object.freeze({NativeScript:0,0:"NativeScript",PlutusScript:1,1:"PlutusScript",PlutusScriptV2:2,2:"PlutusScriptV2"}),c.exports.NetworkIdKind=Object.freeze({Testnet:0,0:"Testnet",Mainnet:1,1:"Mainnet"});class pt{static __wrap(_){_=_>>>0;const e=Object.create(pt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_address_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.address_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.address_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.address_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.address_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.address_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.address_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.address_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const dt=t.__wbindgen_add_to_stack_pointer(-16);var n=nt(_)?0:v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),r=b;t.address_to_bech32(dt,this.__wbg_ptr,n,r);var d=a()[dt/4+0],o=a()[dt/4+1],f=a()[dt/4+2],l=a()[dt/4+3],H=d,rt=o;if(l)throw H=0,rt=0,p(f);return e=H,s=rt,m(H,rt)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.address_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}network_id(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.address_network_id(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Address=pt;class It{static __wrap(_){_=_>>>0;const e=Object.create(It.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_assetname_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.assetname_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return It.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assetname_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return It.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assetname_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return It.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.assetname_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return It.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}name(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_name(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.AssetName=It;class Ut{static __wrap(_){_=_>>>0;const e=Object.create(Ut.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_assetnames_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetnames_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.assetnames_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ut.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.assetnames_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assetnames_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ut.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.assetnames_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetnames_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assetnames_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ut.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return Ut.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.assetnames_get(this.__wbg_ptr,_);return It.__wrap(e)}add(_){g(_,It),t.assetnames_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.AssetNames=Ut;class Dt{static __wrap(_){_=_>>>0;const e=Object.create(Dt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_assets_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assets_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.assets_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Dt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.assets_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assets_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Dt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.assets_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assets_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.assets_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Dt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assets_new();return Dt.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,It),g(e,I);const s=t.assets_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:I.__wrap(s)}get(_){g(_,It);const e=t.assets_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:I.__wrap(e)}keys(){const _=t.assets_keys(this.__wbg_ptr);return Ut.__wrap(_)}}c.exports.Assets=Dt;class Pt{static __wrap(_){_=_>>>0;const e=Object.create(Pt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_auxiliarydata_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydata_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.auxiliarydata_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydata_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.auxiliarydata_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydata_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydata_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.auxiliarydata_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydata_new();return Pt.__wrap(_)}metadata(){const _=t.auxiliarydata_metadata(this.__wbg_ptr);return _===0?void 0:Ot.__wrap(_)}set_metadata(_){g(_,Ot),t.auxiliarydata_set_metadata(this.__wbg_ptr,_.__wbg_ptr)}native_scripts(){const _=t.auxiliarydata_native_scripts(this.__wbg_ptr);return _===0?void 0:Ht.__wrap(_)}set_native_scripts(_){g(_,Ht),t.auxiliarydata_set_native_scripts(this.__wbg_ptr,_.__wbg_ptr)}plutus_scripts(){const _=t.auxiliarydata_plutus_scripts(this.__wbg_ptr);return _===0?void 0:x_.__wrap(_)}set_plutus_scripts(_){g(_,x_),t.auxiliarydata_set_plutus_scripts(this.__wbg_ptr,_.__wbg_ptr)}prefer_alonzo_format(){return t.auxiliarydata_prefer_alonzo_format(this.__wbg_ptr)!==0}set_prefer_alonzo_format(_){t.auxiliarydata_set_prefer_alonzo_format(this.__wbg_ptr,_)}}c.exports.AuxiliaryData=Pt;class qt{static __wrap(_){_=_>>>0;const e=Object.create(qt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_auxiliarydatahash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.auxiliarydatahash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.auxiliarydatahash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.auxiliarydatahash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.AuxiliaryDataHash=qt;class K{static __wrap(_){_=_>>>0;const e=Object.create(K.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_auxiliarydataset_free(_)}static new(){const _=t.auxiliarydataset_new();return K.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(e,Pt);const s=t.auxiliarydataset_insert(this.__wbg_ptr,_,e.__wbg_ptr);return s===0?void 0:Pt.__wrap(s)}get(_){const e=t.auxiliarydataset_get(this.__wbg_ptr,_);return e===0?void 0:Pt.__wrap(e)}indices(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydataset_indices(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=ut(_,e).slice();return t.__wbindgen_free(_,e*4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.AuxiliaryDataSet=K;class q{static __wrap(_){_=_>>>0;const e=Object.create(q.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_baseaddress_free(_)}static new(_,e,s){g(e,Qt),g(s,Qt);const n=t.baseaddress_new(_,e.__wbg_ptr,s.__wbg_ptr);return q.__wrap(n)}payment_cred(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}stake_cred(){const _=t.baseaddress_stake_cred(this.__wbg_ptr);return Qt.__wrap(_)}to_address(){const _=t.baseaddress_to_address(this.__wbg_ptr);return pt.__wrap(_)}static from_address(_){g(_,pt);const e=t.baseaddress_from_address(_.__wbg_ptr);return e===0?void 0:q.__wrap(e)}}c.exports.BaseAddress=q;class z{static __wrap(_){_=_>>>0;const e=Object.create(z.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bigint_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bigint_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bigint_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return z.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bigint_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bigint_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return z.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.bigint_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bigint_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bigint_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return z.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}is_zero(){return t.bigint_is_zero(this.__wbg_ptr)!==0}as_u64(){const _=t.bigint_as_u64(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}as_int(){const _=t.bigint_as_int(this.__wbg_ptr);return _===0?void 0:St.__wrap(_)}static from_str(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bigint_from_str(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return z.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_str(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bigint_to_str(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}add(_){g(_,z);const e=t.bigint_add(this.__wbg_ptr,_.__wbg_ptr);return z.__wrap(e)}mul(_){g(_,z);const e=t.bigint_mul(this.__wbg_ptr,_.__wbg_ptr);return z.__wrap(e)}static one(){const _=t.bigint_one();return z.__wrap(_)}increment(){const _=t.bigint_increment(this.__wbg_ptr);return z.__wrap(_)}div_ceil(_){g(_,z);const e=t.bigint_div_ceil(this.__wbg_ptr,_.__wbg_ptr);return z.__wrap(e)}}c.exports.BigInt=z;class I{static __wrap(_){_=_>>>0;const e=Object.create(I.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bignum_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bignum_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bignum_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bignum_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bignum_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.bignum_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bignum_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bignum_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_str(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bignum_from_str(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_str(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bignum_to_str(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static zero(){const _=t.bignum_zero();return I.__wrap(_)}static one(){const _=t.bignum_one();return I.__wrap(_)}is_zero(){return t.bignum_is_zero(this.__wbg_ptr)!==0}div_floor(_){g(_,I);const e=t.bignum_div_floor(this.__wbg_ptr,_.__wbg_ptr);return I.__wrap(e)}checked_mul(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,I),t.bignum_checked_mul(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}checked_add(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,I),t.bignum_checked_add(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}checked_sub(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,I),t.bignum_checked_sub(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}clamped_sub(_){g(_,I);const e=t.bignum_clamped_sub(this.__wbg_ptr,_.__wbg_ptr);return I.__wrap(e)}compare(_){return g(_,I),t.bignum_compare(this.__wbg_ptr,_.__wbg_ptr)}less_than(_){return g(_,I),t.bignum_less_than(this.__wbg_ptr,_.__wbg_ptr)!==0}static max_value(){const _=t.bignum_max_value();return I.__wrap(_)}static max(_,e){g(_,I),g(e,I);const s=t.bignum_max(_.__wbg_ptr,e.__wbg_ptr);return I.__wrap(s)}}c.exports.BigNum=I;class wt{static __wrap(_){_=_>>>0;const e=Object.create(wt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bip32privatekey_free(_)}derive(_){const e=t.bip32privatekey_derive(this.__wbg_ptr,_);return wt.__wrap(e)}static from_128_xprv(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bip32privatekey_from_128_xprv(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_128_xprv(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_to_128_xprv(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static generate_ed25519_bip32(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_generate_ed25519_bip32(n);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return wt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_raw_key(){const _=t.bip32privatekey_to_raw_key(this.__wbg_ptr);return A_.__wrap(_)}to_public(){const _=t.bip32privatekey_to_public(this.__wbg_ptr);return bt.__wrap(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bip32privatekey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_as_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bip32privatekey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_to_bech32(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_bip39_entropy(_,e){const s=Q(_,t.__wbindgen_malloc),n=b,r=Q(e,t.__wbindgen_malloc),d=b,o=t.bip32privatekey_from_bip39_entropy(s,n,r,d);return wt.__wrap(o)}chaincode(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_chaincode(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bip32privatekey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Bip32PrivateKey=wt;class bt{static __wrap(_){_=_>>>0;const e=Object.create(bt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bip32publickey_free(_)}derive(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_derive(r,this.__wbg_ptr,_);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return bt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_raw_key(){const _=t.bip32publickey_to_raw_key(this.__wbg_ptr);return u_.__wrap(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bip32publickey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return bt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_as_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bip32publickey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return bt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_to_bech32(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}chaincode(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_chaincode(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bip32publickey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return bt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Bip32PublicKey=bt;class st{static __wrap(_){_=_>>>0;const e=Object.create(st.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_block_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.block_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.block_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return st.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.block_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.block_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return st.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.block_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.block_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.block_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return st.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}header(){const _=t.block_header(this.__wbg_ptr);return __.__wrap(_)}transaction_bodies(){const _=t.block_transaction_bodies(this.__wbg_ptr);return me.__wrap(_)}transaction_witness_sets(){const _=t.block_transaction_witness_sets(this.__wbg_ptr);return xe.__wrap(_)}auxiliary_data_set(){const _=t.block_auxiliary_data_set(this.__wbg_ptr);return K.__wrap(_)}invalid_transactions(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.block_invalid_transactions(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=ut(_,e).slice();return t.__wbindgen_free(_,e*4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e,s,n,r){g(_,__),g(e,me),g(s,xe),g(n,K);const d=xt(r,t.__wbindgen_malloc),o=b,f=t.block_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr,n.__wbg_ptr,d,o);return st.__wrap(f)}}c.exports.Block=st;class et{static __wrap(_){_=_>>>0;const e=Object.create(et.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_blockhash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.blockhash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return et.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.blockhash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return et.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.blockhash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return et.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.BlockHash=et;class ot{static __wrap(_){_=_>>>0;const e=Object.create(ot.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bootstrapwitness_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.bootstrapwitness_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bootstrapwitness_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.bootstrapwitness_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}vkey(){const _=t.bootstrapwitness_vkey(this.__wbg_ptr);return Zt.__wrap(_)}signature(){const _=t.bootstrapwitness_signature(this.__wbg_ptr);return it.__wrap(_)}chain_code(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_name(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}attributes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_attributes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e,s,n){g(_,Zt),g(e,it);const r=Q(s,t.__wbindgen_malloc),d=b,o=Q(n,t.__wbindgen_malloc),f=b,l=t.bootstrapwitness_new(_.__wbg_ptr,e.__wbg_ptr,r,d,o,f);return ot.__wrap(l)}}c.exports.BootstrapWitness=ot;class x{static __wrap(_){_=_>>>0;const e=Object.create(x.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_bootstrapwitnesses_free(_)}static new(){const _=t.assetnames_new();return x.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.bootstrapwitnesses_get(this.__wbg_ptr,_);return ot.__wrap(e)}add(_){g(_,ot),t.bootstrapwitnesses_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.BootstrapWitnesses=x;class A{static __wrap(_){_=_>>>0;const e=Object.create(A.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_byronaddress_free(_)}to_base58(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.byronaddress_to_base58(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.byronaddress_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.byronaddress_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}byron_protocol_magic(){return t.byronaddress_byron_protocol_magic(this.__wbg_ptr)>>>0}attributes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.byronaddress_attributes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}network_id(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.byronaddress_network_id(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_base58(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.byronaddress_from_base58(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static icarus_from_key(_,e){g(_,bt);const s=t.byronaddress_icarus_from_key(_.__wbg_ptr,e);return A.__wrap(s)}static is_valid(_){const e=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),s=b;return t.byronaddress_is_valid(e,s)!==0}to_address(){const _=t.byronaddress_to_address(this.__wbg_ptr);return pt.__wrap(_)}static from_address(_){g(_,pt);const e=t.byronaddress_from_address(_.__wbg_ptr);return e===0?void 0:A.__wrap(e)}}c.exports.ByronAddress=A;class B{static __wrap(_){_=_>>>0;const e=Object.create(B.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_certificate_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.certificate_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.certificate_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.certificate_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.certificate_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.certificate_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.certificate_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.certificate_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_stake_registration(_){g(_,ve);const e=t.certificate_new_stake_registration(_.__wbg_ptr);return B.__wrap(e)}static new_stake_deregistration(_){g(_,ye);const e=t.certificate_new_stake_deregistration(_.__wbg_ptr);return B.__wrap(e)}static new_stake_delegation(_){g(_,he);const e=t.certificate_new_stake_delegation(_.__wbg_ptr);return B.__wrap(e)}static new_pool_registration(_){g(_,oe);const e=t.certificate_new_pool_registration(_.__wbg_ptr);return B.__wrap(e)}static new_pool_retirement(_){g(_,ie);const e=t.certificate_new_pool_retirement(_.__wbg_ptr);return B.__wrap(e)}static new_genesis_key_delegation(_){g(_,Rt);const e=t.certificate_new_genesis_key_delegation(_.__wbg_ptr);return B.__wrap(e)}static new_move_instantaneous_rewards_cert(_){g(_,te);const e=t.certificate_new_move_instantaneous_rewards_cert(_.__wbg_ptr);return B.__wrap(e)}kind(){return t.certificate_kind(this.__wbg_ptr)>>>0}as_stake_registration(){const _=t.certificate_as_stake_registration(this.__wbg_ptr);return _===0?void 0:ve.__wrap(_)}as_stake_deregistration(){const _=t.certificate_as_stake_deregistration(this.__wbg_ptr);return _===0?void 0:ye.__wrap(_)}as_stake_delegation(){const _=t.certificate_as_stake_delegation(this.__wbg_ptr);return _===0?void 0:he.__wrap(_)}as_pool_registration(){const _=t.certificate_as_pool_registration(this.__wbg_ptr);return _===0?void 0:oe.__wrap(_)}as_pool_retirement(){const _=t.certificate_as_pool_retirement(this.__wbg_ptr);return _===0?void 0:ie.__wrap(_)}as_genesis_key_delegation(){const _=t.certificate_as_genesis_key_delegation(this.__wbg_ptr);return _===0?void 0:Rt.__wrap(_)}as_move_instantaneous_rewards_cert(){const _=t.certificate_as_move_instantaneous_rewards_cert(this.__wbg_ptr);return _===0?void 0:te.__wrap(_)}}c.exports.Certificate=B;class N{static __wrap(_){_=_>>>0;const e=Object.create(N.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_certificates_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.certificates_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.certificates_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.certificates_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.certificates_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.certificates_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.certificates_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.certificates_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return N.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.certificates_get(this.__wbg_ptr,_);return B.__wrap(e)}add(_){g(_,B),t.certificates_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.Certificates=N;class S{static __wrap(_){_=_>>>0;const e=Object.create(S.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_constrplutusdata_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.constrplutusdata_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.constrplutusdata_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return S.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.constrplutusdata_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.constrplutusdata_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return S.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}alternative(){const _=t.constrplutusdata_alternative(this.__wbg_ptr);return I.__wrap(_)}data(){const _=t.constrplutusdata_data(this.__wbg_ptr);return a_.__wrap(_)}static new(_,e){g(_,I),g(e,a_);const s=t.constrplutusdata_new(_.__wbg_ptr,e.__wbg_ptr);return S.__wrap(s)}}c.exports.ConstrPlutusData=S;class T{static __wrap(_){_=_>>>0;const e=Object.create(T.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_costmodel_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.costmodel_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.costmodel_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.costmodel_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.costmodel_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.costmodel_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.costmodel_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.costmodel_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return T.__wrap(_)}set(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(e,St),t.costmodel_set(d,this.__wbg_ptr,_,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return St.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.costmodel_get(r,this.__wbg_ptr,_);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return St.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}}c.exports.CostModel=T;class M{static __wrap(_){_=_>>>0;const e=Object.create(M.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_costmdls_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.costmdls_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.costmdls_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.costmdls_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.costmdls_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.costmdls_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.costmdls_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.costmdls_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assets_new();return M.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,Jt),g(e,T);const s=t.costmdls_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:T.__wrap(s)}get(_){g(_,Jt);const e=t.costmdls_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:T.__wrap(e)}keys(){const _=t.costmdls_keys(this.__wbg_ptr);return Ge.__wrap(_)}retain_language_versions(_){g(_,Ge);const e=t.costmdls_retain_language_versions(this.__wbg_ptr,_.__wbg_ptr);return M.__wrap(e)}}c.exports.Costmdls=M;class E{static __wrap(_){_=_>>>0;const e=Object.create(E.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_dnsrecordaoraaaa_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.dnsrecordaoraaaa_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return E.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordaoraaaa_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return E.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordaoraaaa_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return E.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordaoraaaa_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return E.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}record(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_record(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}}c.exports.DNSRecordAorAAAA=E;class O{static __wrap(_){_=_>>>0;const e=Object.create(O.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_dnsrecordsrv_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordsrv_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.dnsrecordsrv_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return O.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordsrv_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordsrv_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return O.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordaoraaaa_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return O.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordsrv_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return O.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}record(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_record(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}}c.exports.DNSRecordSRV=O;class F{static __wrap(_){_=_>>>0;const e=Object.create(F.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_datacost_free(_)}static new_coins_per_word(_){g(_,I);const e=t.datacost_new_coins_per_word(_.__wbg_ptr);return F.__wrap(e)}static new_coins_per_byte(_){g(_,I);const e=t.datacost_new_coins_per_byte(_.__wbg_ptr);return F.__wrap(e)}coins_per_byte(){const _=t.datacost_coins_per_byte(this.__wbg_ptr);return I.__wrap(_)}}c.exports.DataCost=F;class U{static __wrap(_){_=_>>>0;const e=Object.create(U.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_datahash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.datahash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.datahash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.datahash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.DataHash=U;class L{static __wrap(_){_=_>>>0;const e=Object.create(L.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_datumsource_free(_)}static new(_){g(_,yt);const e=t.datumsource_new(_.__wbg_ptr);return L.__wrap(e)}static new_ref_input(_){g(_,Ct);const e=t.datumsource_new_ref_input(_.__wbg_ptr);return L.__wrap(e)}}c.exports.DatumSource=L;class X{static __wrap(_){_=_>>>0;const e=Object.create(X.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_ed25519keyhash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ed25519keyhash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.ed25519keyhash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519keyhash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519keyhash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Ed25519KeyHash=X;class tt{static __wrap(_){_=_>>>0;const e=Object.create(tt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_ed25519keyhashes_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ed25519keyhashes_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return tt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519keyhashes_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return tt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519keyhashes_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return tt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return tt.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.ed25519keyhashes_get(this.__wbg_ptr,_);return X.__wrap(e)}add(_){g(_,X),t.ed25519keyhashes_add(this.__wbg_ptr,_.__wbg_ptr)}to_option(){const _=t.ed25519keyhashes_to_option(this.__wbg_ptr);return _===0?void 0:tt.__wrap(_)}}c.exports.Ed25519KeyHashes=tt;class it{static __wrap(_){_=_>>>0;const e=Object.create(it.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_ed25519signature_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32publickey_as_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519signature_to_bech32(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519signature_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519signature_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return it.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ed25519signature_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return it.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ed25519signature_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return it.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Ed25519Signature=it;class Bt{static __wrap(_){_=_>>>0;const e=Object.create(Bt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_enterpriseaddress_free(_)}static new(_,e){g(e,Qt);const s=t.enterpriseaddress_new(_,e.__wbg_ptr);return Bt.__wrap(s)}payment_cred(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}to_address(){const _=t.enterpriseaddress_to_address(this.__wbg_ptr);return pt.__wrap(_)}static from_address(_){g(_,pt);const e=t.enterpriseaddress_from_address(_.__wbg_ptr);return e===0?void 0:Bt.__wrap(e)}}c.exports.EnterpriseAddress=Bt;class vt{static __wrap(_){_=_>>>0;const e=Object.create(vt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_exunitprices_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.exunitprices_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.exunitprices_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return vt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.exunitprices_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.exunitprices_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return vt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.exunitprices_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.exunitprices_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.exunitprices_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return vt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}mem_price(){const _=t.exunitprices_mem_price(this.__wbg_ptr);return zt.__wrap(_)}step_price(){const _=t.exunitprices_step_price(this.__wbg_ptr);return zt.__wrap(_)}static new(_,e){g(_,zt),g(e,zt);const s=t.exunitprices_new(_.__wbg_ptr,e.__wbg_ptr);return vt.__wrap(s)}}c.exports.ExUnitPrices=vt;class at{static __wrap(_){_=_>>>0;const e=Object.create(at.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_exunits_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.exunits_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.exunits_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return at.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.exunits_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.exunits_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return at.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.exunits_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.exunits_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.exunits_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return at.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}mem(){const _=t.exunits_mem(this.__wbg_ptr);return I.__wrap(_)}steps(){const _=t.exunits_steps(this.__wbg_ptr);return I.__wrap(_)}static new(_,e){g(_,I),g(e,I);const s=t.exunits_new(_.__wbg_ptr,e.__wbg_ptr);return at.__wrap(s)}}c.exports.ExUnits=at;class ht{static __wrap(_){_=_>>>0;const e=Object.create(ht.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_fixedtransaction_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.fixedtransaction_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.fixedtransaction_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ht.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.fixedtransaction_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.fixedtransaction_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ht.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e,s){try{const o=t.__wbindgen_add_to_stack_pointer(-16),f=Q(_,t.__wbindgen_malloc),l=b,H=Q(e,t.__wbindgen_malloc),rt=b;t.fixedtransaction_new(o,f,l,H,rt,s);var n=a()[o/4+0],r=a()[o/4+1],d=a()[o/4+2];if(d)throw p(r);return ht.__wrap(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_with_auxiliary(_,e,s,n){try{const f=t.__wbindgen_add_to_stack_pointer(-16),l=Q(_,t.__wbindgen_malloc),H=b,rt=Q(e,t.__wbindgen_malloc),dt=b,Xe=Q(s,t.__wbindgen_malloc),mr=b;t.fixedtransaction_new_with_auxiliary(f,l,H,rt,dt,Xe,mr,n);var r=a()[f/4+0],d=a()[f/4+1],o=a()[f/4+2];if(o)throw p(d);return ht.__wrap(r)}finally{t.__wbindgen_add_to_stack_pointer(16)}}body(){const _=t.fixedtransaction_body(this.__wbg_ptr);return Wt.__wrap(_)}raw_body(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.fixedtransaction_raw_body(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_body(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16),r=Q(_,t.__wbindgen_malloc),d=b;t.fixedtransaction_set_body(n,this.__wbg_ptr,r,d);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_witness_set(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16),r=Q(_,t.__wbindgen_malloc),d=b;t.fixedtransaction_set_witness_set(n,this.__wbg_ptr,r,d);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}witness_set(){const _=t.fixedtransaction_witness_set(this.__wbg_ptr);return y_.__wrap(_)}raw_witness_set(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.fixedtransaction_raw_witness_set(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_is_valid(_){t.fixedtransaction_set_is_valid(this.__wbg_ptr,_)}is_valid(){return t.fixedtransaction_is_valid(this.__wbg_ptr)!==0}set_auxiliary_data(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16),r=Q(_,t.__wbindgen_malloc),d=b;t.fixedtransaction_set_auxiliary_data(n,this.__wbg_ptr,r,d);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}auxiliary_data(){const _=t.fixedtransaction_auxiliary_data(this.__wbg_ptr);return _===0?void 0:Pt.__wrap(_)}raw_auxiliary_data(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.fixedtransaction_raw_auxiliary_data(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];let n;return _!==0&&(n=D(_,e).slice(),t.__wbindgen_free(_,e*1)),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.FixedTransaction=ht;class Ot{static __wrap(_){_=_>>>0;const e=Object.create(Ot.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_generaltransactionmetadata_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.generaltransactionmetadata_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.generaltransactionmetadata_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.generaltransactionmetadata_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.generaltransactionmetadata_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.generaltransactionmetadata_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.generaltransactionmetadata_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.generaltransactionmetadata_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ot.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return Ot.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,I),g(e,mt);const s=t.generaltransactionmetadata_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:mt.__wrap(s)}get(_){g(_,I);const e=t.generaltransactionmetadata_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:mt.__wrap(e)}keys(){const _=t.generaltransactionmetadata_keys(this.__wbg_ptr);return Je.__wrap(_)}}c.exports.GeneralTransactionMetadata=Ot;class i_{static __wrap(_){_=_>>>0;const e=Object.create(i_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_genesisdelegatehash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.genesisdelegatehash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return i_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.ed25519keyhash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesisdelegatehash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return i_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesisdelegatehash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return i_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.GenesisDelegateHash=i_;class Xt{static __wrap(_){_=_>>>0;const e=Object.create(Xt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_genesishash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.genesishash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Xt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.ed25519keyhash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesishash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Xt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesishash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Xt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.GenesisHash=Xt;class w_{static __wrap(_){_=_>>>0;const e=Object.create(w_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_genesishashes_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.genesishashes_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.genesishashes_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return w_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.genesishashes_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesishashes_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return w_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesishashes_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return w_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return w_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.genesishashes_get(this.__wbg_ptr,_);return Xt.__wrap(e)}add(_){g(_,Xt),t.ed25519keyhashes_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.GenesisHashes=w_;class Rt{static __wrap(_){_=_>>>0;const e=Object.create(Rt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_genesiskeydelegation_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.genesiskeydelegation_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.genesiskeydelegation_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Rt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.genesiskeydelegation_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesiskeydelegation_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Rt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.genesiskeydelegation_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.genesiskeydelegation_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.genesiskeydelegation_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Rt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}genesishash(){const _=t.genesiskeydelegation_genesishash(this.__wbg_ptr);return Xt.__wrap(_)}genesis_delegate_hash(){const _=t.genesiskeydelegation_genesis_delegate_hash(this.__wbg_ptr);return i_.__wrap(_)}vrf_keyhash(){const _=t.genesiskeydelegation_vrf_keyhash(this.__wbg_ptr);return q_.__wrap(_)}static new(_,e,s){g(_,Xt),g(e,i_),g(s,q_);const n=t.genesiskeydelegation_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return Rt.__wrap(n)}}c.exports.GenesisKeyDelegation=Rt;class __{static __wrap(_){_=_>>>0;const e=Object.create(__.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_header_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.header_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.header_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return __.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.header_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.header_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return __.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.header_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.header_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.header_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return __.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}header_body(){const _=t.header_header_body(this.__wbg_ptr);return Ft.__wrap(_)}body_signature(){const _=t.header_body_signature(this.__wbg_ptr);return nr.__wrap(_)}static new(_,e){g(_,Ft),g(e,nr);const s=t.header_new(_.__wbg_ptr,e.__wbg_ptr);return __.__wrap(s)}}c.exports.Header=__;class Ft{static __wrap(_){_=_>>>0;const e=Object.create(Ft.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_headerbody_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.headerbody_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.headerbody_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ft.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.headerbody_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.headerbody_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ft.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.headerbody_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.headerbody_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.headerbody_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ft.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}block_number(){return t.headerbody_block_number(this.__wbg_ptr)>>>0}slot(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.headerbody_slot(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot_bignum(){const _=t.headerbody_slot_bignum(this.__wbg_ptr);return I.__wrap(_)}prev_hash(){const _=t.headerbody_prev_hash(this.__wbg_ptr);return _===0?void 0:et.__wrap(_)}issuer_vkey(){const _=t.headerbody_issuer_vkey(this.__wbg_ptr);return Zt.__wrap(_)}vrf_vkey(){const _=t.headerbody_vrf_vkey(this.__wbg_ptr);return Ce.__wrap(_)}has_nonce_and_leader_vrf(){return t.headerbody_has_nonce_and_leader_vrf(this.__wbg_ptr)!==0}nonce_vrf_or_nothing(){const _=t.headerbody_nonce_vrf_or_nothing(this.__wbg_ptr);return _===0?void 0:v_.__wrap(_)}leader_vrf_or_nothing(){const _=t.headerbody_leader_vrf_or_nothing(this.__wbg_ptr);return _===0?void 0:v_.__wrap(_)}has_vrf_result(){return t.headerbody_has_vrf_result(this.__wbg_ptr)!==0}vrf_result_or_nothing(){const _=t.headerbody_vrf_result_or_nothing(this.__wbg_ptr);return _===0?void 0:v_.__wrap(_)}block_body_size(){return t.headerbody_block_body_size(this.__wbg_ptr)>>>0}block_body_hash(){const _=t.headerbody_block_body_hash(this.__wbg_ptr);return et.__wrap(_)}operational_cert(){const _=t.headerbody_operational_cert(this.__wbg_ptr);return U_.__wrap(_)}protocol_version(){const _=t.headerbody_protocol_version(this.__wbg_ptr);return g_.__wrap(_)}static new(_,e,s,n,r,d,o,f,l,H){let rt=0;nt(s)||(g(s,et),rt=s.__destroy_into_raw()),g(n,Zt),g(r,Ce),g(d,v_),g(f,et),g(l,U_),g(H,g_);const dt=t.headerbody_new(_,e,rt,n.__wbg_ptr,r.__wbg_ptr,d.__wbg_ptr,o,f.__wbg_ptr,l.__wbg_ptr,H.__wbg_ptr);return Ft.__wrap(dt)}static new_headerbody(_,e,s,n,r,d,o,f,l,H){g(e,I);let rt=0;nt(s)||(g(s,et),rt=s.__destroy_into_raw()),g(n,Zt),g(r,Ce),g(d,v_),g(f,et),g(l,U_),g(H,g_);const dt=t.headerbody_new_headerbody(_,e.__wbg_ptr,rt,n.__wbg_ptr,r.__wbg_ptr,d.__wbg_ptr,o,f.__wbg_ptr,l.__wbg_ptr,H.__wbg_ptr);return Ft.__wrap(dt)}}c.exports.HeaderBody=Ft;class Kt{static __wrap(_){_=_>>>0;const e=Object.create(Kt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_inputwithscriptwitness_free(_)}static new_with_native_script_witness(_,e){g(_,Ct),g(e,Nt);const s=t.inputwithscriptwitness_new_with_native_script_witness(_.__wbg_ptr,e.__wbg_ptr);return Kt.__wrap(s)}static new_with_plutus_witness(_,e){g(_,Ct),g(e,l_);const s=t.inputwithscriptwitness_new_with_plutus_witness(_.__wbg_ptr,e.__wbg_ptr);return Kt.__wrap(s)}input(){const _=t.inputwithscriptwitness_input(this.__wbg_ptr);return Ct.__wrap(_)}}c.exports.InputWithScriptWitness=Kt;class Et{static __wrap(_){_=_>>>0;const e=Object.create(Et.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_inputswithscriptwitness_free(_)}static new(){const _=t.certificates_new();return Et.__wrap(_)}add(_){g(_,Kt),t.inputswithscriptwitness_add(this.__wbg_ptr,_.__wbg_ptr)}get(_){const e=t.inputswithscriptwitness_get(this.__wbg_ptr,_);return Kt.__wrap(e)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}}c.exports.InputsWithScriptWitness=Et;class St{static __wrap(_){_=_>>>0;const e=Object.create(St.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_int_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.int_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.int_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return St.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.int_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.int_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return St.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.int_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.int_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.int_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return St.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){g(_,I);const e=t.int_new(_.__wbg_ptr);return St.__wrap(e)}static new_negative(_){g(_,I);const e=t.int_new_negative(_.__wbg_ptr);return St.__wrap(e)}static new_i32(_){const e=t.int_new_i32(_);return St.__wrap(e)}is_positive(){return t.int_is_positive(this.__wbg_ptr)!==0}as_positive(){const _=t.int_as_positive(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}as_negative(){const _=t.int_as_negative(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}as_i32(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.int_as_i32(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_i32_or_nothing(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.int_as_i32_or_nothing(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_i32_or_fail(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.int_as_i32_or_fail(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_str(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.int_to_str(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_str(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.int_from_str(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return St.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Int=St;class J_{static __wrap(_){_=_>>>0;const e=Object.create(J_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_ipv4_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv4_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ipv4_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return J_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ipv4_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ipv4_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return J_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.ipv4_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv4_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ipv4_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return J_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ipv4_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return J_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}ip(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv4_ip(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Ipv4=J_;class W_{static __wrap(_){_=_>>>0;const e=Object.create(W_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_ipv6_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv6_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ipv6_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return W_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ipv6_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ipv6_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return W_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.ipv6_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv6_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.ipv6_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return W_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.ipv6_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return W_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}ip(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ipv6_ip(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Ipv6=W_;class rr{static __wrap(_){_=_>>>0;const e=Object.create(rr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_jsvecstring_free(_)}static new(){const _=t.jsvecstring_new();return rr.__wrap(_)}len(){return t.jsvecstring_len(this.__wbg_ptr)>>>0}is_empty(){return t.jsvecstring_is_empty(this.__wbg_ptr)!==0}get(_){let e,s;try{const d=t.__wbindgen_add_to_stack_pointer(-16);t.jsvecstring_get(d,this.__wbg_ptr,_);var n=a()[d/4+0],r=a()[d/4+1];return e=n,s=r,m(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}add(_){const e=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),s=b;t.jsvecstring_add(this.__wbg_ptr,e,s)}}c.exports.JsVecString=rr;class nr{static __wrap(_){_=_>>>0;const e=Object.create(nr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_kessignature_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_name(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.kessignature_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return nr.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.KESSignature=nr;class De{static __wrap(_){_=_>>>0;const e=Object.create(De.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_kesvkey_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.kesvkey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return De.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.kesvkey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return De.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.kesvkey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return De.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.KESVKey=De;class Jt{static __wrap(_){_=_>>>0;const e=Object.create(Jt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_language_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.language_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.language_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Jt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.language_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.language_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Jt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.language_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.language_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.language_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Jt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_plutus_v1(){const _=t.language_new_plutus_v1();return Jt.__wrap(_)}static new_plutus_v2(){const _=t.language_new_plutus_v2();return Jt.__wrap(_)}kind(){return t.language_kind(this.__wbg_ptr)>>>0}}c.exports.Language=Jt;class Ge{static __wrap(_){_=_>>>0;const e=Object.create(Ge.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_languages_free(_)}static new(){const _=t.ed25519keyhashes_new();return Ge.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.languages_get(this.__wbg_ptr,_);return Jt.__wrap(e)}add(_){g(_,Jt);var e=_.__destroy_into_raw();t.languages_add(this.__wbg_ptr,e)}static list(){const _=t.languages_list();return Ge.__wrap(_)}}c.exports.Languages=Ge;class hr{static __wrap(_){_=_>>>0;const e=Object.create(hr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_legacydaedalusprivatekey_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.legacydaedalusprivatekey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return hr.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_as_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}chaincode(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bip32privatekey_chaincode(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.LegacyDaedalusPrivateKey=hr;class ar{static __wrap(_){_=_>>>0;const e=Object.create(ar.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_linearfee_free(_)}constant(){const _=t.linearfee_constant(this.__wbg_ptr);return I.__wrap(_)}coefficient(){const _=t.linearfee_coefficient(this.__wbg_ptr);return I.__wrap(_)}static new(_,e){g(_,I),g(e,I);const s=t.linearfee_new(_.__wbg_ptr,e.__wbg_ptr);return ar.__wrap(s)}}c.exports.LinearFee=ar;class X_{static __wrap(_){_=_>>>0;const e=Object.create(X_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mirtostakecredentials_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.mirtostakecredentials_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.mirtostakecredentials_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.mirtostakecredentials_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.mirtostakecredentials_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.mirtostakecredentials_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.mirtostakecredentials_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.mirtostakecredentials_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return X_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return X_.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,Qt),g(e,St);const s=t.mirtostakecredentials_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:St.__wrap(s)}get(_){g(_,Qt);const e=t.mirtostakecredentials_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:St.__wrap(e)}keys(){const _=t.mirtostakecredentials_keys(this.__wbg_ptr);return Fe.__wrap(_)}}c.exports.MIRToStakeCredentials=X_;class Z_{static __wrap(_){_=_>>>0;const e=Object.create(Z_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_metadatalist_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.metadatalist_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.metadatalist_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Z_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.metadatalist_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.metadatalist_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Z_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return Z_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.metadatalist_get(this.__wbg_ptr,_);return mt.__wrap(e)}add(_){g(_,mt),t.metadatalist_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.MetadataList=Z_;class Te{static __wrap(_){_=_>>>0;const e=Object.create(Te.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_metadatamap_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.metadatamap_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.metadatamap_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Te.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.metadatamap_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.metadatamap_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Te.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return Te.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,mt),g(e,mt);const s=t.metadatamap_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:mt.__wrap(s)}insert_str(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),f=b;g(e,mt),t.metadatamap_insert_str(d,this.__wbg_ptr,o,f,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return s===0?void 0:mt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}insert_i32(_,e){g(e,mt);const s=t.metadatamap_insert_i32(this.__wbg_ptr,_,e.__wbg_ptr);return s===0?void 0:mt.__wrap(s)}get(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,mt),t.metadatamap_get(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_str(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.metadatamap_get_str(r,this.__wbg_ptr,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_i32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.metadatamap_get_i32(r,this.__wbg_ptr,_);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}has(_){return g(_,mt),t.metadatamap_has(this.__wbg_ptr,_.__wbg_ptr)!==0}keys(){const _=t.metadatamap_keys(this.__wbg_ptr);return Z_.__wrap(_)}}c.exports.MetadataMap=Te;class n_{static __wrap(_){_=_>>>0;const e=Object.create(n_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mint_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.mint_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.mint_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return n_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.mint_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.mint_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return n_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.mint_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.mint_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.mint_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return n_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return n_.__wrap(_)}static new_from_entry(_,e){g(_,Mt),g(e,D_);const s=t.mint_new_from_entry(_.__wbg_ptr,e.__wbg_ptr);return n_.__wrap(s)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,Mt),g(e,D_);const s=t.mint_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:D_.__wrap(s)}get(_){g(_,Mt);const e=t.mint_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:D_.__wrap(e)}get_all(_){g(_,Mt);const e=t.mint_get_all(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:Er.__wrap(e)}keys(){const _=t.mint_keys(this.__wbg_ptr);return le.__wrap(_)}as_positive_multiasset(){const _=t.mint_as_positive_multiasset(this.__wbg_ptr);return $t.__wrap(_)}as_negative_multiasset(){const _=t.mint_as_negative_multiasset(this.__wbg_ptr);return $t.__wrap(_)}}c.exports.Mint=n_;class D_{static __wrap(_){_=_>>>0;const e=Object.create(D_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mintassets_free(_)}static new(){const _=t.assets_new();return D_.__wrap(_)}static new_from_entry(_,e){g(_,It),g(e,St);var s=e.__destroy_into_raw();const n=t.mintassets_new_from_entry(_.__wbg_ptr,s);return D_.__wrap(n)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,It),g(e,St);var s=e.__destroy_into_raw();const n=t.mintassets_insert(this.__wbg_ptr,_.__wbg_ptr,s);return n===0?void 0:St.__wrap(n)}get(_){g(_,It);const e=t.mintassets_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:St.__wrap(e)}keys(){const _=t.mintassets_keys(this.__wbg_ptr);return Ut.__wrap(_)}}c.exports.MintAssets=D_;class sr{static __wrap(_){_=_>>>0;const e=Object.create(sr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mintbuilder_free(_)}static new(){const _=t.assets_new();return sr.__wrap(_)}add_asset(_,e,s){g(_,Ye),g(e,It),g(s,St),t.mintbuilder_add_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}set_asset(_,e,s){g(_,Ye),g(e,It),g(s,St),t.mintbuilder_set_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}build(){const _=t.mintbuilder_build(this.__wbg_ptr);return n_.__wrap(_)}get_native_scripts(){const _=t.mintbuilder_get_native_scripts(this.__wbg_ptr);return Ht.__wrap(_)}get_plutus_witnesses(){const _=t.mintbuilder_get_plutus_witnesses(this.__wbg_ptr);return ne.__wrap(_)}get_ref_inputs(){const _=t.mintbuilder_get_ref_inputs(this.__wbg_ptr);return Lt.__wrap(_)}get_redeeemers(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.mintbuilder_get_redeeemers(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return I_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}has_plutus_scripts(){return t.mintbuilder_has_plutus_scripts(this.__wbg_ptr)!==0}has_native_scripts(){return t.mintbuilder_has_native_scripts(this.__wbg_ptr)!==0}}c.exports.MintBuilder=sr;class Ye{static __wrap(_){_=_>>>0;const e=Object.create(Ye.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mintwitness_free(_)}static new_native_script(_){g(_,Nt);const e=t.mintwitness_new_native_script(_.__wbg_ptr);return Ye.__wrap(e)}static new_plutus_script(_,e){g(_,re),g(e,e_);const s=t.mintwitness_new_plutus_script(_.__wbg_ptr,e.__wbg_ptr);return Ye.__wrap(s)}}c.exports.MintWitness=Ye;class Er{static __wrap(_){_=_>>>0;const e=Object.create(Er.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_mintsassets_free(_)}}c.exports.MintsAssets=Er;class T_{static __wrap(_){_=_>>>0;const e=Object.create(T_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_moveinstantaneousreward_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousreward_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.moveinstantaneousreward_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousreward_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.moveinstantaneousreward_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousreward_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousreward_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.moveinstantaneousreward_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return T_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_to_other_pot(_,e){g(e,I);const s=t.moveinstantaneousreward_new_to_other_pot(_,e.__wbg_ptr);return T_.__wrap(s)}static new_to_stake_creds(_,e){g(e,X_);const s=t.moveinstantaneousreward_new_to_stake_creds(_,e.__wbg_ptr);return T_.__wrap(s)}pot(){return t.moveinstantaneousreward_pot(this.__wbg_ptr)>>>0}kind(){return t.moveinstantaneousreward_kind(this.__wbg_ptr)>>>0}as_to_other_pot(){const _=t.moveinstantaneousreward_as_to_other_pot(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}as_to_stake_creds(){const _=t.moveinstantaneousreward_as_to_stake_creds(this.__wbg_ptr);return _===0?void 0:X_.__wrap(_)}}c.exports.MoveInstantaneousReward=T_;class te{static __wrap(_){_=_>>>0;const e=Object.create(te.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_moveinstantaneousrewardscert_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousrewardscert_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.moveinstantaneousrewardscert_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return te.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousrewardscert_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.moveinstantaneousrewardscert_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return te.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousrewardscert_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.moveinstantaneousrewardscert_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.moveinstantaneousrewardscert_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return te.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}move_instantaneous_reward(){const _=t.moveinstantaneousrewardscert_move_instantaneous_reward(this.__wbg_ptr);return T_.__wrap(_)}static new(_){g(_,T_);const e=t.moveinstantaneousrewardscert_new(_.__wbg_ptr);return te.__wrap(e)}}c.exports.MoveInstantaneousRewardsCert=te;class $t{static __wrap(_){_=_>>>0;const e=Object.create($t.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_multiasset_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.multiasset_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.multiasset_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return $t.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.multiasset_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.multiasset_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return $t.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.multiasset_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.multiasset_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.multiasset_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return $t.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assets_new();return $t.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,Mt),g(e,Dt);const s=t.multiasset_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:Dt.__wrap(s)}get(_){g(_,Mt);const e=t.multiasset_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:Dt.__wrap(e)}set_asset(_,e,s){g(_,Mt),g(e,It),g(s,I);var n=s.__destroy_into_raw();const r=t.multiasset_set_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,n);return r===0?void 0:I.__wrap(r)}get_asset(_,e){g(_,Mt),g(e,It);const s=t.multiasset_get_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return I.__wrap(s)}keys(){const _=t.multiasset_keys(this.__wbg_ptr);return le.__wrap(_)}sub(_){g(_,$t);const e=t.multiasset_sub(this.__wbg_ptr,_.__wbg_ptr);return $t.__wrap(e)}}c.exports.MultiAsset=$t;class _e{static __wrap(_){_=_>>>0;const e=Object.create(_e.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_multihostname_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.multihostname_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.multihostname_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return _e.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.multihostname_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.multihostname_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return _e.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.multihostname_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.multihostname_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.multihostname_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return _e.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}dns_name(){const _=t.multihostname_dns_name(this.__wbg_ptr);return O.__wrap(_)}static new(_){g(_,O);const e=t.multihostname_new(_.__wbg_ptr);return _e.__wrap(e)}}c.exports.MultiHostName=_e;class Nt{static __wrap(_){_=_>>>0;const e=Object.create(Nt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_nativescript_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.nativescript_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.nativescript_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Nt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.nativescript_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.nativescript_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Nt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.nativescript_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.nativescript_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.nativescript_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Nt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}hash(){const _=t.nativescript_hash(this.__wbg_ptr);return Mt.__wrap(_)}static new_script_pubkey(_){g(_,ue);const e=t.nativescript_new_script_pubkey(_.__wbg_ptr);return Nt.__wrap(e)}static new_script_all(_){g(_,pe);const e=t.nativescript_new_script_all(_.__wbg_ptr);return Nt.__wrap(e)}static new_script_any(_){g(_,we);const e=t.nativescript_new_script_any(_.__wbg_ptr);return Nt.__wrap(e)}static new_script_n_of_k(_){g(_,ge);const e=t.nativescript_new_script_n_of_k(_.__wbg_ptr);return Nt.__wrap(e)}static new_timelock_start(_){g(_,K_);const e=t.nativescript_new_timelock_start(_.__wbg_ptr);return Nt.__wrap(e)}static new_timelock_expiry(_){g(_,F_);const e=t.nativescript_new_timelock_expiry(_.__wbg_ptr);return Nt.__wrap(e)}kind(){return t.nativescript_kind(this.__wbg_ptr)>>>0}as_script_pubkey(){const _=t.nativescript_as_script_pubkey(this.__wbg_ptr);return _===0?void 0:ue.__wrap(_)}as_script_all(){const _=t.nativescript_as_script_all(this.__wbg_ptr);return _===0?void 0:pe.__wrap(_)}as_script_any(){const _=t.nativescript_as_script_any(this.__wbg_ptr);return _===0?void 0:we.__wrap(_)}as_script_n_of_k(){const _=t.nativescript_as_script_n_of_k(this.__wbg_ptr);return _===0?void 0:ge.__wrap(_)}as_timelock_start(){const _=t.nativescript_as_timelock_start(this.__wbg_ptr);return _===0?void 0:K_.__wrap(_)}as_timelock_expiry(){const _=t.nativescript_as_timelock_expiry(this.__wbg_ptr);return _===0?void 0:F_.__wrap(_)}get_required_signers(){const _=t.nativescript_get_required_signers(this.__wbg_ptr);return tt.__wrap(_)}}c.exports.NativeScript=Nt;class Ht{static __wrap(_){_=_>>>0;const e=Object.create(Ht.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_nativescripts_free(_)}static new(){const _=t.certificates_new();return Ht.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.nativescripts_get(this.__wbg_ptr,_);return Nt.__wrap(e)}add(_){g(_,Nt),t.nativescripts_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.NativeScripts=Ht;class N_{static __wrap(_){_=_>>>0;const e=Object.create(N_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_networkid_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.networkid_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.networkid_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.networkid_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.networkid_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.networkid_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.networkid_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.networkid_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return N_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static testnet(){const _=t.language_new_plutus_v1();return N_.__wrap(_)}static mainnet(){const _=t.language_new_plutus_v2();return N_.__wrap(_)}kind(){return t.networkid_kind(this.__wbg_ptr)>>>0}}c.exports.NetworkId=N_;class Ne{static __wrap(_){_=_>>>0;const e=Object.create(Ne.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_networkinfo_free(_)}static new(_,e){const s=t.networkinfo_new(_,e);return Ne.__wrap(s)}network_id(){return t.networkinfo_network_id(this.__wbg_ptr)}protocol_magic(){return t.networkinfo_protocol_magic(this.__wbg_ptr)>>>0}static testnet_preview(){const _=t.networkinfo_testnet_preview();return Ne.__wrap(_)}static testnet_preprod(){const _=t.networkinfo_testnet_preprod();return Ne.__wrap(_)}static testnet(){const _=t.networkinfo_testnet();return Ne.__wrap(_)}static mainnet(){const _=t.networkinfo_mainnet();return Ne.__wrap(_)}}c.exports.NetworkInfo=Ne;class ee{static __wrap(_){_=_>>>0;const e=Object.create(ee.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_nonce_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.nonce_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.nonce_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ee.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.nonce_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.nonce_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ee.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.nonce_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.nonce_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.nonce_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ee.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_identity(){const _=t.nonce_new_identity();return ee.__wrap(_)}static new_from_hash(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.nonce_new_from_hash(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ee.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_hash(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.nonce_get_hash(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];let n;return _!==0&&(n=D(_,e).slice(),t.__wbindgen_free(_,e*1)),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Nonce=ee;class U_{static __wrap(_){_=_>>>0;const e=Object.create(U_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_operationalcert_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.operationalcert_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.operationalcert_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.operationalcert_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.operationalcert_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.operationalcert_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.operationalcert_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.operationalcert_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return U_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}hot_vkey(){const _=t.operationalcert_hot_vkey(this.__wbg_ptr);return De.__wrap(_)}sequence_number(){return t.operationalcert_sequence_number(this.__wbg_ptr)>>>0}kes_period(){return t.operationalcert_kes_period(this.__wbg_ptr)>>>0}sigma(){const _=t.operationalcert_sigma(this.__wbg_ptr);return it.__wrap(_)}static new(_,e,s,n){g(_,De),g(n,it);const r=t.operationalcert_new(_.__wbg_ptr,e,s,n.__wbg_ptr);return U_.__wrap(r)}}c.exports.OperationalCert=U_;class or{static __wrap(_){_=_>>>0;const e=Object.create(or.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_outputdatum_free(_)}static new_data_hash(_){g(_,U);const e=t.outputdatum_new_data_hash(_.__wbg_ptr);return or.__wrap(e)}static new_data(_){g(_,yt);const e=t.datumsource_new(_.__wbg_ptr);return or.__wrap(e)}data_hash(){const _=t.outputdatum_data_hash(this.__wbg_ptr);return _===0?void 0:U.__wrap(_)}data(){const _=t.outputdatum_data(this.__wbg_ptr);return _===0?void 0:yt.__wrap(_)}}c.exports.OutputDatum=or;class yt{static __wrap(_){_=_>>>0;const e=Object.create(yt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutusdata_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutusdata_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutusdata_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.plutusdata_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutusdata_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_constr_plutus_data(_){g(_,S);const e=t.plutusdata_new_constr_plutus_data(_.__wbg_ptr);return yt.__wrap(e)}static new_empty_constr_plutus_data(_){g(_,I);const e=t.plutusdata_new_empty_constr_plutus_data(_.__wbg_ptr);return yt.__wrap(e)}static new_single_value_constr_plutus_data(_,e){g(_,I),g(e,yt);const s=t.plutusdata_new_single_value_constr_plutus_data(_.__wbg_ptr,e.__wbg_ptr);return yt.__wrap(s)}static new_map(_){g(_,Ue);const e=t.plutusdata_new_map(_.__wbg_ptr);return yt.__wrap(e)}static new_list(_){g(_,a_);const e=t.plutusdata_new_list(_.__wbg_ptr);return yt.__wrap(e)}static new_integer(_){g(_,z);const e=t.plutusdata_new_integer(_.__wbg_ptr);return yt.__wrap(e)}static new_bytes(_){const e=Q(_,t.__wbindgen_malloc),s=b,n=t.plutusdata_new_bytes(e,s);return yt.__wrap(n)}kind(){return t.plutusdata_kind(this.__wbg_ptr)>>>0}as_constr_plutus_data(){const _=t.plutusdata_as_constr_plutus_data(this.__wbg_ptr);return _===0?void 0:S.__wrap(_)}as_map(){const _=t.plutusdata_as_map(this.__wbg_ptr);return _===0?void 0:Ue.__wrap(_)}as_list(){const _=t.plutusdata_as_list(this.__wbg_ptr);return _===0?void 0:a_.__wrap(_)}as_integer(){const _=t.plutusdata_as_integer(this.__wbg_ptr);return _===0?void 0:z.__wrap(_)}as_bytes(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.plutusdata_as_bytes(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];let n;return _!==0&&(n=D(_,e).slice(),t.__wbindgen_free(_,e*1)),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16);t.decode_plutus_datum_to_json_str(H,this.__wbg_ptr,_);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_json(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),f=b;t.encode_json_str_to_plutus_datum(d,o,f,e);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return yt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_address(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,pt),t.plutusdata_from_address(r,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.PlutusData=yt;class a_{static __wrap(_){_=_>>>0;const e=Object.create(a_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutuslist_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutuslist_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutuslist_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return a_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.plutuslist_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutuslist_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return a_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.plutuslist_new();return a_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.plutuslist_get(this.__wbg_ptr,_);return yt.__wrap(e)}add(_){g(_,yt),t.plutuslist_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.PlutusList=a_;class Ue{static __wrap(_){_=_>>>0;const e=Object.create(Ue.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutusmap_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutusmap_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutusmap_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ue.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.plutusmap_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutusmap_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ue.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return Ue.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,yt),g(e,yt);const s=t.plutusmap_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:yt.__wrap(s)}get(_){g(_,yt);const e=t.plutusmap_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:yt.__wrap(e)}keys(){const _=t.plutusmap_keys(this.__wbg_ptr);return a_.__wrap(_)}}c.exports.PlutusMap=Ue;class Gt{static __wrap(_){_=_>>>0;const e=Object.create(Gt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutusscript_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscript_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutusscript_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscript_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutusscript_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){const e=Q(_,t.__wbindgen_malloc),s=b,n=t.plutusscript_new(e,s);return Gt.__wrap(n)}static new_v2(_){const e=Q(_,t.__wbindgen_malloc),s=b,n=t.plutusscript_new_v2(e,s);return Gt.__wrap(n)}static new_with_version(_,e){const s=Q(_,t.__wbindgen_malloc),n=b;g(e,Jt);const r=t.plutusscript_new_with_version(s,n,e.__wbg_ptr);return Gt.__wrap(r)}bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_name(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes_v2(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutusscript_from_bytes_v2(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes_with_version(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=Q(_,t.__wbindgen_malloc),f=b;g(e,Jt),t.plutusscript_from_bytes_with_version(d,o,f,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return Gt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_hex_with_version(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),f=b;g(e,Jt),t.plutusscript_from_hex_with_version(d,o,f,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return Gt.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}hash(){const _=t.plutusscript_hash(this.__wbg_ptr);return Mt.__wrap(_)}language_version(){const _=t.plutusscript_language_version(this.__wbg_ptr);return Jt.__wrap(_)}}c.exports.PlutusScript=Gt;class re{static __wrap(_){_=_>>>0;const e=Object.create(re.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutusscriptsource_free(_)}static new(_){g(_,Gt);const e=t.plutusscriptsource_new(_.__wbg_ptr);return re.__wrap(e)}static new_ref_input(_,e){g(_,Mt),g(e,Ct);const s=t.plutusscriptsource_new_ref_input(_.__wbg_ptr,e.__wbg_ptr);return re.__wrap(s)}static new_ref_input_with_lang_ver(_,e,s){g(_,Mt),g(e,Ct),g(s,Jt);const n=t.plutusscriptsource_new_ref_input_with_lang_ver(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return re.__wrap(n)}}c.exports.PlutusScriptSource=re;class x_{static __wrap(_){_=_>>>0;const e=Object.create(x_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutusscripts_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscripts_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.plutusscripts_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return x_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscripts_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutusscripts_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return x_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscripts_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.plutusscripts_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.plutusscripts_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return x_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return x_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.plutusscripts_get(this.__wbg_ptr,_);return Gt.__wrap(e)}add(_){g(_,Gt),t.plutusscripts_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.PlutusScripts=x_;class l_{static __wrap(_){_=_>>>0;const e=Object.create(l_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutuswitness_free(_)}static new(_,e,s){g(_,Gt),g(e,yt),g(s,e_);const n=t.plutuswitness_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return l_.__wrap(n)}static new_with_ref(_,e,s){g(_,re),g(e,L),g(s,e_);const n=t.plutuswitness_new_with_ref(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return l_.__wrap(n)}static new_without_datum(_,e){g(_,Gt),g(e,e_);const s=t.plutuswitness_new_without_datum(_.__wbg_ptr,e.__wbg_ptr);return l_.__wrap(s)}static new_with_ref_without_datum(_,e){g(_,re),g(e,e_);const s=t.plutuswitness_new_with_ref_without_datum(_.__wbg_ptr,e.__wbg_ptr);return l_.__wrap(s)}script(){const _=t.plutuswitness_script(this.__wbg_ptr);return _===0?void 0:Gt.__wrap(_)}datum(){const _=t.plutuswitness_datum(this.__wbg_ptr);return _===0?void 0:yt.__wrap(_)}redeemer(){const _=t.plutuswitness_redeemer(this.__wbg_ptr);return e_.__wrap(_)}}c.exports.PlutusWitness=l_;class ne{static __wrap(_){_=_>>>0;const e=Object.create(ne.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_plutuswitnesses_free(_)}static new(){const _=t.certificates_new();return ne.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.plutuswitnesses_get(this.__wbg_ptr,_);return l_.__wrap(e)}add(_){g(_,l_),t.plutuswitnesses_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.PlutusWitnesses=ne;class $e{static __wrap(_){_=_>>>0;const e=Object.create($e.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_pointer_free(_)}static new(_,e,s){const n=t.pointer_new(_,e,s);return $e.__wrap(n)}static new_pointer(_,e,s){g(_,I),g(e,I),g(s,I);const n=t.pointer_new_pointer(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return $e.__wrap(n)}slot(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.pointer_slot(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}tx_index(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.pointer_tx_index(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}cert_index(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.pointer_cert_index(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot_bignum(){const _=t.exunits_mem(this.__wbg_ptr);return I.__wrap(_)}tx_index_bignum(){const _=t.exunits_steps(this.__wbg_ptr);return I.__wrap(_)}cert_index_bignum(){const _=t.constrplutusdata_alternative(this.__wbg_ptr);return I.__wrap(_)}}c.exports.Pointer=$e;class yr{static __wrap(_){_=_>>>0;const e=Object.create(yr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_pointeraddress_free(_)}static new(_,e,s){g(e,Qt),g(s,$e);const n=t.pointeraddress_new(_,e.__wbg_ptr,s.__wbg_ptr);return yr.__wrap(n)}payment_cred(){const _=t.pointeraddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}stake_pointer(){const _=t.pointeraddress_stake_pointer(this.__wbg_ptr);return $e.__wrap(_)}to_address(){const _=t.pointeraddress_to_address(this.__wbg_ptr);return pt.__wrap(_)}static from_address(_){g(_,pt);const e=t.pointeraddress_from_address(_.__wbg_ptr);return e===0?void 0:yr.__wrap(e)}}c.exports.PointerAddress=yr;class ae{static __wrap(_){_=_>>>0;const e=Object.create(ae.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_poolmetadata_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolmetadata_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.poolmetadata_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.poolmetadata_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolmetadata_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.poolmetadata_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolmetadata_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolmetadata_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}url(){const _=t.multihostname_dns_name(this.__wbg_ptr);return Ae.__wrap(_)}pool_metadata_hash(){const _=t.poolmetadata_pool_metadata_hash(this.__wbg_ptr);return Pe.__wrap(_)}static new(_,e){g(_,Ae),g(e,Pe);const s=t.poolmetadata_new(_.__wbg_ptr,e.__wbg_ptr);return ae.__wrap(s)}}c.exports.PoolMetadata=ae;class Pe{static __wrap(_){_=_>>>0;const e=Object.create(Pe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_poolmetadatahash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.poolmetadatahash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolmetadatahash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolmetadatahash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.PoolMetadataHash=Pe;class se{static __wrap(_){_=_>>>0;const e=Object.create(se.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_poolparams_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolparams_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.poolparams_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return se.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.poolparams_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolparams_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return se.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.poolparams_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolparams_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolparams_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return se.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}operator(){const _=t.poolparams_operator(this.__wbg_ptr);return X.__wrap(_)}vrf_keyhash(){const _=t.poolparams_vrf_keyhash(this.__wbg_ptr);return q_.__wrap(_)}pledge(){const _=t.headerbody_slot_bignum(this.__wbg_ptr);return I.__wrap(_)}cost(){const _=t.poolparams_cost(this.__wbg_ptr);return I.__wrap(_)}margin(){const _=t.poolparams_margin(this.__wbg_ptr);return zt.__wrap(_)}reward_account(){const _=t.poolparams_reward_account(this.__wbg_ptr);return j_.__wrap(_)}pool_owners(){const _=t.poolparams_pool_owners(this.__wbg_ptr);return tt.__wrap(_)}relays(){const _=t.poolparams_relays(this.__wbg_ptr);return ce.__wrap(_)}pool_metadata(){const _=t.poolparams_pool_metadata(this.__wbg_ptr);return _===0?void 0:ae.__wrap(_)}static new(_,e,s,n,r,d,o,f,l){g(_,X),g(e,q_),g(s,I),g(n,I),g(r,zt),g(d,j_),g(o,tt),g(f,ce);let H=0;nt(l)||(g(l,ae),H=l.__destroy_into_raw());const rt=t.poolparams_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr,n.__wbg_ptr,r.__wbg_ptr,d.__wbg_ptr,o.__wbg_ptr,f.__wbg_ptr,H);return se.__wrap(rt)}}c.exports.PoolParams=se;class oe{static __wrap(_){_=_>>>0;const e=Object.create(oe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_poolregistration_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolregistration_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.poolregistration_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return oe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.poolregistration_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolregistration_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return oe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.poolregistration_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolregistration_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolregistration_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return oe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}pool_params(){const _=t.poolregistration_pool_params(this.__wbg_ptr);return se.__wrap(_)}static new(_){g(_,se);const e=t.poolregistration_new(_.__wbg_ptr);return oe.__wrap(e)}}c.exports.PoolRegistration=oe;class ie{static __wrap(_){_=_>>>0;const e=Object.create(ie.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_poolretirement_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolretirement_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.poolretirement_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.poolretirement_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolretirement_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.poolretirement_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.poolretirement_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.poolretirement_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}pool_keyhash(){const _=t.poolretirement_pool_keyhash(this.__wbg_ptr);return X.__wrap(_)}epoch(){return t.poolretirement_epoch(this.__wbg_ptr)>>>0}static new(_,e){g(_,X);const s=t.poolretirement_new(_.__wbg_ptr,e);return ie.__wrap(s)}}c.exports.PoolRetirement=ie;class A_{static __wrap(_){_=_>>>0;const e=Object.create(A_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_privatekey_free(_)}to_public(){const _=t.privatekey_to_public(this.__wbg_ptr);return u_.__wrap(_)}static generate_ed25519(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.privatekey_generate_ed25519(n);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return A_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static generate_ed25519extended(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.privatekey_generate_ed25519extended(n);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return A_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.privatekey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.privatekey_to_bech32(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}as_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.privatekey_as_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_extended_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.privatekey_from_extended_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_normal_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.privatekey_from_normal_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}sign(_){const e=Q(_,t.__wbindgen_malloc),s=b,n=t.privatekey_sign(this.__wbg_ptr,e,s);return it.__wrap(n)}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.privatekey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.privatekey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return A_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.PrivateKey=A_;class de{static __wrap(_){_=_>>>0;const e=Object.create(de.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_proposedprotocolparameterupdates_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.proposedprotocolparameterupdates_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.proposedprotocolparameterupdates_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return de.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.proposedprotocolparameterupdates_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.proposedprotocolparameterupdates_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return de.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.proposedprotocolparameterupdates_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.proposedprotocolparameterupdates_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.proposedprotocolparameterupdates_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return de.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return de.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,Xt),g(e,P_);const s=t.proposedprotocolparameterupdates_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:P_.__wrap(s)}get(_){g(_,Xt);const e=t.proposedprotocolparameterupdates_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:P_.__wrap(e)}keys(){const _=t.proposedprotocolparameterupdates_keys(this.__wbg_ptr);return w_.__wrap(_)}}c.exports.ProposedProtocolParameterUpdates=de;class P_{static __wrap(_){_=_>>>0;const e=Object.create(P_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_protocolparamupdate_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.protocolparamupdate_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return P_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.protocolparamupdate_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return P_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.protocolparamupdate_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return P_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_minfee_a(_){g(_,I),t.protocolparamupdate_set_minfee_a(this.__wbg_ptr,_.__wbg_ptr)}minfee_a(){const _=t.protocolparamupdate_minfee_a(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_minfee_b(_){g(_,I),t.protocolparamupdate_set_minfee_b(this.__wbg_ptr,_.__wbg_ptr)}minfee_b(){const _=t.protocolparamupdate_minfee_b(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_max_block_body_size(_){t.protocolparamupdate_set_max_block_body_size(this.__wbg_ptr,_)}max_block_body_size(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_block_body_size(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_max_tx_size(_){t.protocolparamupdate_set_max_tx_size(this.__wbg_ptr,_)}max_tx_size(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_tx_size(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_max_block_header_size(_){t.protocolparamupdate_set_max_block_header_size(this.__wbg_ptr,_)}max_block_header_size(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_block_header_size(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_key_deposit(_){g(_,I),t.protocolparamupdate_set_key_deposit(this.__wbg_ptr,_.__wbg_ptr)}key_deposit(){const _=t.protocolparamupdate_key_deposit(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_pool_deposit(_){g(_,I),t.protocolparamupdate_set_pool_deposit(this.__wbg_ptr,_.__wbg_ptr)}pool_deposit(){const _=t.protocolparamupdate_pool_deposit(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_max_epoch(_){t.protocolparamupdate_set_max_epoch(this.__wbg_ptr,_)}max_epoch(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_epoch(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_n_opt(_){t.protocolparamupdate_set_n_opt(this.__wbg_ptr,_)}n_opt(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_n_opt(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_pool_pledge_influence(_){g(_,zt),t.protocolparamupdate_set_pool_pledge_influence(this.__wbg_ptr,_.__wbg_ptr)}pool_pledge_influence(){const _=t.protocolparamupdate_pool_pledge_influence(this.__wbg_ptr);return _===0?void 0:zt.__wrap(_)}set_expansion_rate(_){g(_,zt),t.protocolparamupdate_set_expansion_rate(this.__wbg_ptr,_.__wbg_ptr)}expansion_rate(){const _=t.protocolparamupdate_expansion_rate(this.__wbg_ptr);return _===0?void 0:zt.__wrap(_)}set_treasury_growth_rate(_){g(_,zt),t.protocolparamupdate_set_treasury_growth_rate(this.__wbg_ptr,_.__wbg_ptr)}treasury_growth_rate(){const _=t.protocolparamupdate_treasury_growth_rate(this.__wbg_ptr);return _===0?void 0:zt.__wrap(_)}d(){const _=t.protocolparamupdate_d(this.__wbg_ptr);return _===0?void 0:zt.__wrap(_)}extra_entropy(){const _=t.protocolparamupdate_extra_entropy(this.__wbg_ptr);return _===0?void 0:ee.__wrap(_)}set_protocol_version(_){g(_,g_),t.protocolparamupdate_set_protocol_version(this.__wbg_ptr,_.__wbg_ptr)}protocol_version(){const _=t.protocolparamupdate_protocol_version(this.__wbg_ptr);return _===0?void 0:g_.__wrap(_)}set_min_pool_cost(_){g(_,I),t.protocolparamupdate_set_min_pool_cost(this.__wbg_ptr,_.__wbg_ptr)}min_pool_cost(){const _=t.protocolparamupdate_min_pool_cost(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_ada_per_utxo_byte(_){g(_,I),t.protocolparamupdate_set_ada_per_utxo_byte(this.__wbg_ptr,_.__wbg_ptr)}ada_per_utxo_byte(){const _=t.protocolparamupdate_ada_per_utxo_byte(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_cost_models(_){g(_,M),t.protocolparamupdate_set_cost_models(this.__wbg_ptr,_.__wbg_ptr)}cost_models(){const _=t.protocolparamupdate_cost_models(this.__wbg_ptr);return _===0?void 0:M.__wrap(_)}set_execution_costs(_){g(_,vt),t.protocolparamupdate_set_execution_costs(this.__wbg_ptr,_.__wbg_ptr)}execution_costs(){const _=t.protocolparamupdate_execution_costs(this.__wbg_ptr);return _===0?void 0:vt.__wrap(_)}set_max_tx_ex_units(_){g(_,at),t.protocolparamupdate_set_max_tx_ex_units(this.__wbg_ptr,_.__wbg_ptr)}max_tx_ex_units(){const _=t.protocolparamupdate_max_tx_ex_units(this.__wbg_ptr);return _===0?void 0:at.__wrap(_)}set_max_block_ex_units(_){g(_,at),t.protocolparamupdate_set_max_block_ex_units(this.__wbg_ptr,_.__wbg_ptr)}max_block_ex_units(){const _=t.protocolparamupdate_max_block_ex_units(this.__wbg_ptr);return _===0?void 0:at.__wrap(_)}set_max_value_size(_){t.protocolparamupdate_set_max_value_size(this.__wbg_ptr,_)}max_value_size(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_value_size(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_collateral_percentage(_){t.protocolparamupdate_set_collateral_percentage(this.__wbg_ptr,_)}collateral_percentage(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_collateral_percentage(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_max_collateral_inputs(_){t.protocolparamupdate_set_max_collateral_inputs(this.__wbg_ptr,_)}max_collateral_inputs(){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.protocolparamupdate_max_collateral_inputs(s,this.__wbg_ptr);var _=a()[s/4+0],e=a()[s/4+1];return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.protocolparamupdate_new();return P_.__wrap(_)}}c.exports.ProtocolParamUpdate=P_;class g_{static __wrap(_){_=_>>>0;const e=Object.create(g_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_protocolversion_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.protocolversion_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.protocolversion_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return g_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.protocolversion_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.protocolversion_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return g_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.protocolversion_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.protocolversion_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.protocolversion_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return g_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}major(){return t.networkinfo_protocol_magic(this.__wbg_ptr)>>>0}minor(){return t.protocolversion_minor(this.__wbg_ptr)>>>0}static new(_,e){const s=t.protocolversion_new(_,e);return g_.__wrap(s)}}c.exports.ProtocolVersion=g_;class u_{static __wrap(_){_=_>>>0;const e=Object.create(u_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_publickey_free(_)}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.publickey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return u_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.publickey_to_bech32(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}as_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.publickey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return u_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}verify(_,e){const s=Q(_,t.__wbindgen_malloc),n=b;return g(e,it),t.publickey_verify(this.__wbg_ptr,s,n,e.__wbg_ptr)!==0}hash(){const _=t.publickey_hash(this.__wbg_ptr);return X.__wrap(_)}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.publickey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.publickey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return u_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.PublicKey=u_;class Sr{static __wrap(_){_=_>>>0;const e=Object.create(Sr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_publickeys_free(_)}constructor(){const _=t.ed25519keyhashes_new();return Sr.__wrap(_)}size(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.publickeys_get(this.__wbg_ptr,_);return u_.__wrap(e)}add(_){g(_,u_),t.publickeys_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.PublicKeys=Sr;class e_{static __wrap(_){_=_>>>0;const e=Object.create(e_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_redeemer_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemer_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.redeemer_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return e_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.redeemer_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemer_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return e_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.redeemer_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemer_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemer_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return e_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}tag(){const _=t.redeemer_tag(this.__wbg_ptr);return b_.__wrap(_)}index(){const _=t.redeemer_index(this.__wbg_ptr);return I.__wrap(_)}data(){const _=t.redeemer_data(this.__wbg_ptr);return yt.__wrap(_)}ex_units(){const _=t.redeemer_ex_units(this.__wbg_ptr);return at.__wrap(_)}static new(_,e,s,n){g(_,b_),g(e,I),g(s,yt),g(n,at);const r=t.redeemer_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr,n.__wbg_ptr);return e_.__wrap(r)}}c.exports.Redeemer=e_;class b_{static __wrap(_){_=_>>>0;const e=Object.create(b_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_redeemertag_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemertag_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.redeemertag_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return b_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.redeemertag_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemertag_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return b_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.redeemertag_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemertag_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemertag_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return b_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_spend(){const _=t.redeemertag_new_spend();return b_.__wrap(_)}static new_mint(){const _=t.redeemertag_new_mint();return b_.__wrap(_)}static new_cert(){const _=t.redeemertag_new_cert();return b_.__wrap(_)}static new_reward(){const _=t.redeemertag_new_reward();return b_.__wrap(_)}kind(){return t.redeemertag_kind(this.__wbg_ptr)>>>0}}c.exports.RedeemerTag=b_;class I_{static __wrap(_){_=_>>>0;const e=Object.create(I_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_redeemers_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemers_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.redeemers_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.redeemers_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemers_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.redeemers_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemers_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.redeemers_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return I_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.redeemers_get(this.__wbg_ptr,_);return e_.__wrap(e)}add(_){g(_,e_),t.redeemers_add(this.__wbg_ptr,_.__wbg_ptr)}total_ex_units(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.redeemers_total_ex_units(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return at.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.Redeemers=I_;class C_{static __wrap(_){_=_>>>0;const e=Object.create(C_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_relay_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.relay_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.relay_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return C_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.relay_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.relay_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return C_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.relay_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.relay_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.relay_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return C_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_single_host_addr(_){g(_,be);const e=t.relay_new_single_host_addr(_.__wbg_ptr);return C_.__wrap(e)}static new_single_host_name(_){g(_,fe);const e=t.relay_new_single_host_name(_.__wbg_ptr);return C_.__wrap(e)}static new_multi_host_name(_){g(_,_e);const e=t.relay_new_multi_host_name(_.__wbg_ptr);return C_.__wrap(e)}kind(){return t.relay_kind(this.__wbg_ptr)>>>0}as_single_host_addr(){const _=t.relay_as_single_host_addr(this.__wbg_ptr);return _===0?void 0:be.__wrap(_)}as_single_host_name(){const _=t.relay_as_single_host_name(this.__wbg_ptr);return _===0?void 0:fe.__wrap(_)}as_multi_host_name(){const _=t.relay_as_multi_host_name(this.__wbg_ptr);return _===0?void 0:_e.__wrap(_)}}c.exports.Relay=C_;class ce{static __wrap(_){_=_>>>0;const e=Object.create(ce.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_relays_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.relays_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.relays_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.relays_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.relays_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.relays_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.relays_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.relays_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return ce.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.relays_get(this.__wbg_ptr,_);return C_.__wrap(e)}add(_){g(_,C_),t.relays_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.Relays=ce;class j_{static __wrap(_){_=_>>>0;const e=Object.create(j_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_rewardaddress_free(_)}static new(_,e){g(e,Qt);const s=t.enterpriseaddress_new(_,e.__wbg_ptr);return j_.__wrap(s)}payment_cred(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}to_address(){const _=t.rewardaddress_to_address(this.__wbg_ptr);return pt.__wrap(_)}static from_address(_){g(_,pt);const e=t.rewardaddress_from_address(_.__wbg_ptr);return e===0?void 0:j_.__wrap(e)}}c.exports.RewardAddress=j_;class Me{static __wrap(_){_=_>>>0;const e=Object.create(Me.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_rewardaddresses_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.rewardaddresses_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.rewardaddresses_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.rewardaddresses_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.rewardaddresses_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.rewardaddresses_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.rewardaddresses_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.rewardaddresses_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return Me.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.rewardaddresses_get(this.__wbg_ptr,_);return j_.__wrap(e)}add(_){g(_,j_),t.rewardaddresses_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.RewardAddresses=Me;class pe{static __wrap(_){_=_>>>0;const e=Object.create(pe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptall_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptall_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptall_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scriptall_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptall_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.scriptall_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptall_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptall_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return pe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}native_scripts(){const _=t.scriptall_native_scripts(this.__wbg_ptr);return Ht.__wrap(_)}static new(_){g(_,Ht);const e=t.scriptall_new(_.__wbg_ptr);return pe.__wrap(e)}}c.exports.ScriptAll=pe;class we{static __wrap(_){_=_>>>0;const e=Object.create(we.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptany_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptany_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptany_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return we.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scriptany_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptany_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return we.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.scriptall_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptany_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptany_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return we.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}native_scripts(){const _=t.scriptall_native_scripts(this.__wbg_ptr);return Ht.__wrap(_)}static new(_){g(_,Ht);const e=t.scriptall_new(_.__wbg_ptr);return we.__wrap(e)}}c.exports.ScriptAny=we;class M_{static __wrap(_){_=_>>>0;const e=Object.create(M_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptdatahash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptdatahash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptdatahash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptdatahash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return M_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.ScriptDataHash=M_;class Mt{static __wrap(_){_=_>>>0;const e=Object.create(Mt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scripthash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scripthash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.ed25519keyhash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scripthash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scripthash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.ScriptHash=Mt;class le{static __wrap(_){_=_>>>0;const e=Object.create(le.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scripthashes_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scripthashes_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scripthashes_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return le.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scripthashes_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scripthashes_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return le.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.ed25519keyhashes_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scripthashes_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return le.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return le.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.scripthashes_get(this.__wbg_ptr,_);return Mt.__wrap(e)}add(_){g(_,Mt),t.ed25519keyhashes_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.ScriptHashes=le;class ge{static __wrap(_){_=_>>>0;const e=Object.create(ge.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptnofk_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptnofk_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptnofk_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ge.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scriptnofk_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptnofk_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ge.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.scriptnofk_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptnofk_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptnofk_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ge.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}n(){return t.scriptnofk_n(this.__wbg_ptr)>>>0}native_scripts(){const _=t.scriptall_native_scripts(this.__wbg_ptr);return Ht.__wrap(_)}static new(_,e){g(e,Ht);const s=t.scriptnofk_new(_,e.__wbg_ptr);return ge.__wrap(s)}}c.exports.ScriptNOfK=ge;class ue{static __wrap(_){_=_>>>0;const e=Object.create(ue.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptpubkey_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptpubkey_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptpubkey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ue.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scriptpubkey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptpubkey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ue.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.scriptpubkey_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptpubkey_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptpubkey_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ue.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}addr_keyhash(){const _=t.scriptpubkey_addr_keyhash(this.__wbg_ptr);return X.__wrap(_)}static new(_){g(_,X);const e=t.scriptpubkey_new(_.__wbg_ptr);return ue.__wrap(e)}}c.exports.ScriptPubkey=ue;class B_{static __wrap(_){_=_>>>0;const e=Object.create(B_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_scriptref_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptref_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.scriptref_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.scriptref_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptref_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.scriptref_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.scriptref_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.scriptref_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return B_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_native_script(_){g(_,Nt);const e=t.scriptref_new_native_script(_.__wbg_ptr);return B_.__wrap(e)}static new_plutus_script(_){g(_,Gt);const e=t.scriptref_new_plutus_script(_.__wbg_ptr);return B_.__wrap(e)}is_native_script(){return t.scriptref_is_native_script(this.__wbg_ptr)!==0}is_plutus_script(){return t.scriptref_is_plutus_script(this.__wbg_ptr)!==0}native_script(){const _=t.scriptref_native_script(this.__wbg_ptr);return _===0?void 0:Nt.__wrap(_)}plutus_script(){const _=t.scriptref_plutus_script(this.__wbg_ptr);return _===0?void 0:Gt.__wrap(_)}}c.exports.ScriptRef=B_;class vr{static __wrap(_){_=_>>>0;const e=Object.create(vr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_serializedaddress_free(_)}static new(_,e,s){const n=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),r=b,d=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b,f=v(s,t.__wbindgen_malloc,t.__wbindgen_realloc),l=b,H=t.serializedaddress_new(n,r,d,o,f,l);return vr.__wrap(H)}get_pub_key_hash(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.serializedaddress_get_pub_key_hash(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}get_script_hash(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.serializedaddress_get_script_hash(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}get_stake_key_hash(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.serializedaddress_get_stake_key_hash(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}}c.exports.SerializedAddress=vr;class be{static __wrap(_){_=_>>>0;const e=Object.create(be.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_singlehostaddr_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostaddr_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.singlehostaddr_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return be.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostaddr_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.singlehostaddr_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return be.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostaddr_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostaddr_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.singlehostaddr_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return be.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}port(){const _=t.singlehostaddr_port(this.__wbg_ptr);return _===16777215?void 0:_}ipv4(){const _=t.singlehostaddr_ipv4(this.__wbg_ptr);return _===0?void 0:J_.__wrap(_)}ipv6(){const _=t.singlehostaddr_ipv6(this.__wbg_ptr);return _===0?void 0:W_.__wrap(_)}static new(_,e,s){let n=0;nt(e)||(g(e,J_),n=e.__destroy_into_raw());let r=0;nt(s)||(g(s,W_),r=s.__destroy_into_raw());const d=t.singlehostaddr_new(nt(_)?16777215:_,n,r);return be.__wrap(d)}}c.exports.SingleHostAddr=be;class fe{static __wrap(_){_=_>>>0;const e=Object.create(fe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_singlehostname_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostname_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.singlehostname_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostname_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.singlehostname_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostname_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.singlehostname_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.singlehostname_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}port(){const _=t.singlehostname_port(this.__wbg_ptr);return _===16777215?void 0:_}dns_name(){const _=t.multihostname_dns_name(this.__wbg_ptr);return E.__wrap(_)}static new(_,e){g(e,E);const s=t.singlehostname_new(nt(_)?16777215:_,e.__wbg_ptr);return fe.__wrap(s)}}c.exports.SingleHostName=fe;class Qt{static __wrap(_){_=_>>>0;const e=Object.create(Qt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_stakecredential_free(_)}static from_keyhash(_){g(_,X);const e=t.stakecredential_from_keyhash(_.__wbg_ptr);return Qt.__wrap(e)}static from_scripthash(_){g(_,Mt);const e=t.stakecredential_from_scripthash(_.__wbg_ptr);return Qt.__wrap(e)}to_keyhash(){const _=t.stakecredential_to_keyhash(this.__wbg_ptr);return _===0?void 0:X.__wrap(_)}to_scripthash(){const _=t.stakecredential_to_scripthash(this.__wbg_ptr);return _===0?void 0:Mt.__wrap(_)}kind(){return t.networkid_kind(this.__wbg_ptr)>>>0}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredential_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.stakecredential_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredential_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakecredential_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredential_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredential_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakecredential_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Qt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.StakeCredential=Qt;class Fe{static __wrap(_){_=_>>>0;const e=Object.create(Fe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_stakecredentials_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredentials_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.stakecredentials_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredentials_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakecredentials_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredentials_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakecredentials_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakecredentials_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Fe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return Fe.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.stakecredentials_get(this.__wbg_ptr,_);return Qt.__wrap(e)}add(_){g(_,Qt),t.stakecredentials_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.StakeCredentials=Fe;class he{static __wrap(_){_=_>>>0;const e=Object.create(he.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_stakedelegation_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakedelegation_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.stakedelegation_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return he.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.stakedelegation_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakedelegation_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return he.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.stakedelegation_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakedelegation_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakedelegation_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return he.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}stake_credential(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}pool_keyhash(){const _=t.stakedelegation_pool_keyhash(this.__wbg_ptr);return X.__wrap(_)}static new(_,e){g(_,Qt),g(e,X);const s=t.stakedelegation_new(_.__wbg_ptr,e.__wbg_ptr);return he.__wrap(s)}}c.exports.StakeDelegation=he;class ye{static __wrap(_){_=_>>>0;const e=Object.create(ye.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_stakederegistration_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakederegistration_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.stakederegistration_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ye.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.stakederegistration_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakederegistration_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ye.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.stakederegistration_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakederegistration_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakederegistration_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ye.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}stake_credential(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}static new(_){g(_,Qt);const e=t.stakederegistration_new(_.__wbg_ptr);return ye.__wrap(e)}}c.exports.StakeDeregistration=ye;class ve{static __wrap(_){_=_>>>0;const e=Object.create(ve.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_stakeregistration_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakeregistration_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.stakeregistration_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ve.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.stakeregistration_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakeregistration_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ve.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.stakederegistration_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.stakeregistration_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.stakeregistration_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ve.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}stake_credential(){const _=t.baseaddress_payment_cred(this.__wbg_ptr);return Qt.__wrap(_)}static new(_){g(_,Qt);const e=t.stakederegistration_new(_.__wbg_ptr);return ve.__wrap(e)}}c.exports.StakeRegistration=ve;class Qr{static __wrap(_){_=_>>>0;const e=Object.create(Qr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_strings_free(_)}static new(){const _=t.assetnames_new();return Qr.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){let e,s;try{const d=t.__wbindgen_add_to_stack_pointer(-16);t.strings_get(d,this.__wbg_ptr,_);var n=a()[d/4+0],r=a()[d/4+1];return e=n,s=r,m(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}add(_){const e=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),s=b;t.strings_add(this.__wbg_ptr,e,s)}}c.exports.Strings=Qr;class F_{static __wrap(_){_=_>>>0;const e=Object.create(F_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_timelockexpiry_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.timelockexpiry_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return F_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.timelockexpiry_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return F_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.timelockexpiry_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return F_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_slot(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot_bignum(){const _=t.linearfee_constant(this.__wbg_ptr);return I.__wrap(_)}static new(_){const e=t.timelockexpiry_new(_);return F_.__wrap(e)}static new_timelockexpiry(_){g(_,I);const e=t.exunits_mem(_.__wbg_ptr);return F_.__wrap(e)}}c.exports.TimelockExpiry=F_;class K_{static __wrap(_){_=_>>>0;const e=Object.create(K_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_timelockstart_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockstart_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.timelockstart_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return K_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.timelockstart_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.timelockstart_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return K_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockstart_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.timelockstart_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return K_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.timelockexpiry_slot(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}slot_bignum(){const _=t.linearfee_constant(this.__wbg_ptr);return I.__wrap(_)}static new(_){const e=t.timelockexpiry_new(_);return K_.__wrap(e)}static new_timelockstart(_){g(_,I);const e=t.exunits_mem(_.__wbg_ptr);return K_.__wrap(e)}}c.exports.TimelockStart=K_;class f_{static __wrap(_){_=_>>>0;const e=Object.create(f_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transaction_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transaction_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transaction_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return f_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transaction_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transaction_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return f_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transaction_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transaction_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transaction_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return f_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}body(){const _=t.fixedtransaction_body(this.__wbg_ptr);return Wt.__wrap(_)}witness_set(){const _=t.transaction_witness_set(this.__wbg_ptr);return y_.__wrap(_)}is_valid(){return t.transaction_is_valid(this.__wbg_ptr)!==0}auxiliary_data(){const _=t.transaction_auxiliary_data(this.__wbg_ptr);return _===0?void 0:Pt.__wrap(_)}set_is_valid(_){t.transaction_set_is_valid(this.__wbg_ptr,_)}static new(_,e,s){g(_,Wt),g(e,y_);let n=0;nt(s)||(g(s,Pt),n=s.__destroy_into_raw());const r=t.transaction_new(_.__wbg_ptr,e.__wbg_ptr,n);return f_.__wrap(r)}}c.exports.Transaction=f_;class Or{static __wrap(_){_=_>>>0;const e=Object.create(Or.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbatch_free(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionbatch_get(this.__wbg_ptr,_);return f_.__wrap(e)}}c.exports.TransactionBatch=Or;class Dr{static __wrap(_){_=_>>>0;const e=Object.create(Dr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbatchlist_free(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionbatchlist_get(this.__wbg_ptr,_);return Or.__wrap(e)}}c.exports.TransactionBatchList=Dr;class me{static __wrap(_){_=_>>>0;const e=Object.create(me.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbodies_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbodies_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionbodies_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbodies_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionbodies_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbodies_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbodies_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionbodies_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return me.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return me.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionbodies_get(this.__wbg_ptr,_);return Wt.__wrap(e)}add(_){g(_,Wt),t.transactionbodies_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.TransactionBodies=me;class Wt{static __wrap(_){_=_>>>0;const e=Object.create(Wt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbody_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionbody_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionbody_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionbody_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Wt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}inputs(){const _=t.transactionbody_inputs(this.__wbg_ptr);return Lt.__wrap(_)}outputs(){const _=t.transactionbody_outputs(this.__wbg_ptr);return H_.__wrap(_)}fee(){const _=t.transactionbody_fee(this.__wbg_ptr);return I.__wrap(_)}ttl(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_ttl(r,this.__wbg_ptr);var _=a()[r/4+0],e=a()[r/4+1],s=a()[r/4+2],n=a()[r/4+3];if(n)throw p(s);return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}ttl_bignum(){const _=t.transactionbody_ttl_bignum(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}set_ttl(_){g(_,I),t.protocolparamupdate_set_minfee_a(this.__wbg_ptr,_.__wbg_ptr)}remove_ttl(){t.transactionbody_remove_ttl(this.__wbg_ptr)}set_certs(_){g(_,N),t.transactionbody_set_certs(this.__wbg_ptr,_.__wbg_ptr)}certs(){const _=t.transactionbody_certs(this.__wbg_ptr);return _===0?void 0:N.__wrap(_)}set_withdrawals(_){g(_,L_),t.transactionbody_set_withdrawals(this.__wbg_ptr,_.__wbg_ptr)}withdrawals(){const _=t.transactionbody_withdrawals(this.__wbg_ptr);return _===0?void 0:L_.__wrap(_)}set_update(_){g(_,Ie),t.transactionbody_set_update(this.__wbg_ptr,_.__wbg_ptr)}update(){const _=t.transactionbody_update(this.__wbg_ptr);return _===0?void 0:Ie.__wrap(_)}set_auxiliary_data_hash(_){g(_,qt),t.transactionbody_set_auxiliary_data_hash(this.__wbg_ptr,_.__wbg_ptr)}auxiliary_data_hash(){const _=t.transactionbody_auxiliary_data_hash(this.__wbg_ptr);return _===0?void 0:qt.__wrap(_)}set_validity_start_interval(_){t.transactionbody_set_validity_start_interval(this.__wbg_ptr,_)}set_validity_start_interval_bignum(_){g(_,I);var e=_.__destroy_into_raw();t.transactionbody_set_validity_start_interval_bignum(this.__wbg_ptr,e)}validity_start_interval_bignum(){const _=t.protocolparamupdate_minfee_b(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}validity_start_interval(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbody_validity_start_interval(r,this.__wbg_ptr);var _=a()[r/4+0],e=a()[r/4+1],s=a()[r/4+2],n=a()[r/4+3];if(n)throw p(s);return _===0?void 0:e>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_mint(_){g(_,n_),t.transactionbody_set_mint(this.__wbg_ptr,_.__wbg_ptr)}mint(){const _=t.transactionbody_mint(this.__wbg_ptr);return _===0?void 0:n_.__wrap(_)}multiassets(){const _=t.transactionbody_multiassets(this.__wbg_ptr);return _===0?void 0:n_.__wrap(_)}set_reference_inputs(_){g(_,Lt),t.transactionbody_set_reference_inputs(this.__wbg_ptr,_.__wbg_ptr)}reference_inputs(){const _=t.transactionbody_reference_inputs(this.__wbg_ptr);return _===0?void 0:Lt.__wrap(_)}set_script_data_hash(_){g(_,M_),t.transactionbody_set_script_data_hash(this.__wbg_ptr,_.__wbg_ptr)}script_data_hash(){const _=t.transactionbody_script_data_hash(this.__wbg_ptr);return _===0?void 0:M_.__wrap(_)}set_collateral(_){g(_,Lt),t.transactionbody_set_collateral(this.__wbg_ptr,_.__wbg_ptr)}collateral(){const _=t.transactionbody_collateral(this.__wbg_ptr);return _===0?void 0:Lt.__wrap(_)}set_required_signers(_){g(_,tt),t.transactionbody_set_required_signers(this.__wbg_ptr,_.__wbg_ptr)}required_signers(){const _=t.transactionbody_required_signers(this.__wbg_ptr);return _===0?void 0:tt.__wrap(_)}set_network_id(_){g(_,N_),t.transactionbody_set_network_id(this.__wbg_ptr,_.__wbg_ptr)}network_id(){const _=t.transactionbody_network_id(this.__wbg_ptr);return _===0?void 0:N_.__wrap(_)}set_collateral_return(_){g(_,Yt),t.transactionbody_set_collateral_return(this.__wbg_ptr,_.__wbg_ptr)}collateral_return(){const _=t.transactionbody_collateral_return(this.__wbg_ptr);return _===0?void 0:Yt.__wrap(_)}set_total_collateral(_){g(_,I),t.protocolparamupdate_set_key_deposit(this.__wbg_ptr,_.__wbg_ptr)}total_collateral(){const _=t.protocolparamupdate_key_deposit(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}static new(_,e,s,n){g(_,Lt),g(e,H_),g(s,I);const r=t.transactionbody_new(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr,!nt(n),nt(n)?0:n);return Wt.__wrap(r)}static new_tx_body(_,e,s){g(_,Lt),g(e,H_),g(s,I);const n=t.transactionbody_new_tx_body(_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);return Wt.__wrap(n)}}c.exports.TransactionBody=Wt;class Tr{static __wrap(_){_=_>>>0;const e=Object.create(Tr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbuilder_free(_)}add_inputs_from(_,e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,We),t.transactionbuilder_add_inputs_from(r,this.__wbg_ptr,_.__wbg_ptr,e);var s=a()[r/4+0],n=a()[r/4+1];if(n)throw p(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_inputs(_){g(_,dr),t.transactionbuilder_set_inputs(this.__wbg_ptr,_.__wbg_ptr)}set_collateral(_){g(_,dr),t.transactionbuilder_set_collateral(this.__wbg_ptr,_.__wbg_ptr)}set_collateral_return(_){g(_,Yt),t.transactionbuilder_set_collateral_return(this.__wbg_ptr,_.__wbg_ptr)}set_collateral_return_and_total(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16);g(_,Yt),t.transactionbuilder_set_collateral_return_and_total(n,this.__wbg_ptr,_.__wbg_ptr);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_total_collateral(_){g(_,I),t.transactionbuilder_set_total_collateral(this.__wbg_ptr,_.__wbg_ptr)}set_total_collateral_and_return(_,e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,I),g(e,pt),t.transactionbuilder_set_total_collateral_and_return(r,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];if(n)throw p(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}add_reference_input(_){g(_,Ct),t.transactionbuilder_add_reference_input(this.__wbg_ptr,_.__wbg_ptr)}add_key_input(_,e,s){g(_,X),g(e,Ct),g(s,gt),t.transactionbuilder_add_key_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_script_input(_,e,s){g(_,Mt),g(e,Ct),g(s,gt),t.transactionbuilder_add_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_native_script_input(_,e,s){g(_,Nt),g(e,Ct),g(s,gt),t.transactionbuilder_add_native_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_plutus_script_input(_,e,s){g(_,l_),g(e,Ct),g(s,gt),t.transactionbuilder_add_plutus_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_bootstrap_input(_,e,s){g(_,A),g(e,Ct),g(s,gt),t.transactionbuilder_add_bootstrap_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_input(_,e,s){g(_,pt),g(e,Ct),g(s,gt),t.transactionbuilder_add_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}count_missing_input_scripts(){return t.transactionbuilder_count_missing_input_scripts(this.__wbg_ptr)>>>0}add_required_native_input_scripts(_){return g(_,Ht),t.transactionbuilder_add_required_native_input_scripts(this.__wbg_ptr,_.__wbg_ptr)>>>0}add_required_plutus_input_scripts(_){return g(_,ne),t.transactionbuilder_add_required_plutus_input_scripts(this.__wbg_ptr,_.__wbg_ptr)>>>0}get_native_input_scripts(){const _=t.transactionbuilder_get_native_input_scripts(this.__wbg_ptr);return _===0?void 0:Ht.__wrap(_)}get_plutus_input_scripts(){const _=t.transactionbuilder_get_plutus_input_scripts(this.__wbg_ptr);return _===0?void 0:ne.__wrap(_)}fee_for_input(_,e,s){try{const o=t.__wbindgen_add_to_stack_pointer(-16);g(_,pt),g(e,Ct),g(s,gt),t.transactionbuilder_fee_for_input(o,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr);var n=a()[o/4+0],r=a()[o/4+1],d=a()[o/4+2];if(d)throw p(r);return I.__wrap(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}add_output(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16);g(_,Yt),t.transactionbuilder_add_output(n,this.__wbg_ptr,_.__wbg_ptr);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}fee_for_output(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,Yt),t.transactionbuilder_fee_for_output(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return I.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_fee(_){g(_,I),t.transactionbuilder_set_fee(this.__wbg_ptr,_.__wbg_ptr)}set_ttl(_){t.transactionbuilder_set_ttl(this.__wbg_ptr,_)}set_ttl_bignum(_){g(_,I),t.transactionbuilder_set_ttl_bignum(this.__wbg_ptr,_.__wbg_ptr)}set_validity_start_interval(_){t.transactionbuilder_set_validity_start_interval(this.__wbg_ptr,_)}set_validity_start_interval_bignum(_){g(_,I);var e=_.__destroy_into_raw();t.transactionbuilder_set_validity_start_interval_bignum(this.__wbg_ptr,e)}set_certs(_){g(_,N),t.transactionbuilder_set_certs(this.__wbg_ptr,_.__wbg_ptr)}set_withdrawals(_){g(_,L_),t.transactionbuilder_set_withdrawals(this.__wbg_ptr,_.__wbg_ptr)}get_auxiliary_data(){const _=t.transactionbuilder_get_auxiliary_data(this.__wbg_ptr);return _===0?void 0:Pt.__wrap(_)}set_auxiliary_data(_){g(_,Pt),t.transactionbuilder_set_auxiliary_data(this.__wbg_ptr,_.__wbg_ptr)}set_metadata(_){g(_,Ot),t.transactionbuilder_set_metadata(this.__wbg_ptr,_.__wbg_ptr)}add_metadatum(_,e){g(_,I),g(e,mt),t.transactionbuilder_add_metadatum(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr)}add_json_metadatum(_,e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,I);const d=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionbuilder_add_json_metadatum(r,this.__wbg_ptr,_.__wbg_ptr,d,o);var s=a()[r/4+0],n=a()[r/4+1];if(n)throw p(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}add_json_metadatum_with_schema(_,e,s){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(_,I);const o=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),f=b;t.transactionbuilder_add_json_metadatum_with_schema(d,this.__wbg_ptr,_.__wbg_ptr,o,f,s);var n=a()[d/4+0],r=a()[d/4+1];if(r)throw p(n)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_mint_builder(_){g(_,sr),t.transactionbuilder_set_mint_builder(this.__wbg_ptr,_.__wbg_ptr)}get_mint_builder(){const _=t.transactionbuilder_get_mint_builder(this.__wbg_ptr);return _===0?void 0:sr.__wrap(_)}set_mint(_,e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,n_),g(e,Ht),t.transactionbuilder_set_mint(r,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];if(n)throw p(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_mint(){const _=t.transactionbuilder_get_mint(this.__wbg_ptr);return _===0?void 0:n_.__wrap(_)}get_mint_scripts(){const _=t.transactionbuilder_get_mint_scripts(this.__wbg_ptr);return _===0?void 0:Ht.__wrap(_)}set_mint_asset(_,e){g(_,Nt),g(e,D_),t.transactionbuilder_set_mint_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr)}add_mint_asset(_,e,s){g(_,Nt),g(e,It),g(s,St);var n=s.__destroy_into_raw();t.transactionbuilder_add_mint_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,n)}add_mint_asset_and_output(_,e,s,n,r){try{const l=t.__wbindgen_add_to_stack_pointer(-16);g(_,Nt),g(e,It),g(s,St);var d=s.__destroy_into_raw();g(n,E_),g(r,I),t.transactionbuilder_add_mint_asset_and_output(l,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,d,n.__wbg_ptr,r.__wbg_ptr);var o=a()[l/4+0],f=a()[l/4+1];if(f)throw p(o)}finally{t.__wbindgen_add_to_stack_pointer(16)}}add_mint_asset_and_output_min_required_coin(_,e,s,n){try{const f=t.__wbindgen_add_to_stack_pointer(-16);g(_,Nt),g(e,It),g(s,St);var r=s.__destroy_into_raw();g(n,E_),t.transactionbuilder_add_mint_asset_and_output_min_required_coin(f,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,r,n.__wbg_ptr);var d=a()[f/4+0],o=a()[f/4+1];if(o)throw p(d)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){g(_,ir);const e=t.transactionbuilder_new(_.__wbg_ptr);return Tr.__wrap(e)}get_reference_inputs(){const _=t.transactionbuilder_get_reference_inputs(this.__wbg_ptr);return Lt.__wrap(_)}get_explicit_input(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_explicit_input(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_implicit_input(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_implicit_input(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_total_input(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_total_input(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_total_output(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_total_output(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_explicit_output(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_explicit_output(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_deposit(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_get_deposit(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return I.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}get_fee_if_set(){const _=t.transactionbuilder_get_fee_if_set(this.__wbg_ptr);return _===0?void 0:I.__wrap(_)}add_change_if_needed(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,pt),t.transactionbuilder_add_change_if_needed(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return e!==0}finally{t.__wbindgen_add_to_stack_pointer(16)}}add_change_if_needed_with_datum(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(_,pt),g(e,or),t.transactionbuilder_add_change_if_needed_with_datum(d,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return s!==0}finally{t.__wbindgen_add_to_stack_pointer(16)}}calc_script_data_hash(_){try{const n=t.__wbindgen_add_to_stack_pointer(-16);g(_,M),t.transactionbuilder_calc_script_data_hash(n,this.__wbg_ptr,_.__wbg_ptr);var e=a()[n/4+0],s=a()[n/4+1];if(s)throw p(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_script_data_hash(_){g(_,M_),t.transactionbuilder_set_script_data_hash(this.__wbg_ptr,_.__wbg_ptr)}remove_script_data_hash(){t.transactionbuilder_remove_script_data_hash(this.__wbg_ptr)}add_required_signer(_){g(_,X),t.transactionbuilder_add_required_signer(this.__wbg_ptr,_.__wbg_ptr)}full_size(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_full_size(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return _>>>0}finally{t.__wbindgen_add_to_stack_pointer(16)}}output_sizes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_output_sizes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=ut(_,e).slice();return t.__wbindgen_free(_,e*4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}build(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_build(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return Wt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}build_tx(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_build_tx(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return f_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}build_tx_unsafe(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_build_tx_unsafe(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return f_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}min_fee(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilder_min_fee(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return I.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.TransactionBuilder=Tr;class ir{static __wrap(_){_=_>>>0;const e=Object.create(ir.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbuilderconfig_free(_)}}c.exports.TransactionBuilderConfig=ir;class d_{static __wrap(_){_=_>>>0;const e=Object.create(d_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionbuilderconfigbuilder_free(_)}static new(){const _=t.transactionbuilderconfigbuilder_new();return d_.__wrap(_)}fee_algo(_){g(_,ar);const e=t.transactionbuilderconfigbuilder_fee_algo(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}coins_per_utxo_word(_){g(_,I);const e=t.transactionbuilderconfigbuilder_coins_per_utxo_word(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}coins_per_utxo_byte(_){g(_,I);const e=t.transactionbuilderconfigbuilder_coins_per_utxo_byte(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}ex_unit_prices(_){g(_,vt);const e=t.transactionbuilderconfigbuilder_ex_unit_prices(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}pool_deposit(_){g(_,I);const e=t.transactionbuilderconfigbuilder_pool_deposit(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}key_deposit(_){g(_,I);const e=t.transactionbuilderconfigbuilder_key_deposit(this.__wbg_ptr,_.__wbg_ptr);return d_.__wrap(e)}max_value_size(_){const e=t.transactionbuilderconfigbuilder_max_value_size(this.__wbg_ptr,_);return d_.__wrap(e)}max_tx_size(_){const e=t.transactionbuilderconfigbuilder_max_tx_size(this.__wbg_ptr,_);return d_.__wrap(e)}prefer_pure_change(_){const e=t.transactionbuilderconfigbuilder_prefer_pure_change(this.__wbg_ptr,_);return d_.__wrap(e)}build(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionbuilderconfigbuilder_build(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return ir.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.TransactionBuilderConfigBuilder=d_;class h_{static __wrap(_){_=_>>>0;const e=Object.create(h_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionhash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionhash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return h_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionhash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return h_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionhash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return h_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.TransactionHash=h_;class Ct{static __wrap(_){_=_>>>0;const e=Object.create(Ct.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactioninput_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninput_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactioninput_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ct.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninput_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactioninput_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ct.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninput_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninput_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactioninput_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ct.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}transaction_id(){const _=t.transactioninput_transaction_id(this.__wbg_ptr);return h_.__wrap(_)}index(){return t.transactioninput_index(this.__wbg_ptr)>>>0}static new(_,e){g(_,h_);const s=t.transactioninput_new(_.__wbg_ptr,e);return Ct.__wrap(s)}}c.exports.TransactionInput=Ct;class Lt{static __wrap(_){_=_>>>0;const e=Object.create(Lt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactioninputs_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninputs_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactioninputs_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Lt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninputs_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactioninputs_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Lt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninputs_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactioninputs_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactioninputs_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Lt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return Lt.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactioninputs_get(this.__wbg_ptr,_);return Ct.__wrap(e)}add(_){g(_,Ct),t.transactioninputs_add(this.__wbg_ptr,_.__wbg_ptr)}to_option(){const _=t.transactioninputs_to_option(this.__wbg_ptr);return _===0?void 0:Lt.__wrap(_)}}c.exports.TransactionInputs=Lt;class mt{static __wrap(_){_=_>>>0;const e=Object.create(mt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionmetadatum_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionmetadatum_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionmetadatum_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_map(_){g(_,Te);const e=t.transactionmetadatum_new_map(_.__wbg_ptr);return mt.__wrap(e)}static new_list(_){g(_,Z_);const e=t.transactionmetadatum_new_list(_.__wbg_ptr);return mt.__wrap(e)}static new_int(_){g(_,St);const e=t.transactionmetadatum_new_int(_.__wbg_ptr);return mt.__wrap(e)}static new_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionmetadatum_new_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new_text(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionmetadatum_new_text(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return mt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}kind(){return t.plutusdata_kind(this.__wbg_ptr)>>>0}as_map(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_as_map(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return Te.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_list(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_as_list(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return Z_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_int(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_as_int(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return St.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_bytes(){try{const d=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_as_bytes(d,this.__wbg_ptr);var _=a()[d/4+0],e=a()[d/4+1],s=a()[d/4+2],n=a()[d/4+3];if(n)throw p(s);var r=D(_,e).slice();return t.__wbindgen_free(_,e*1),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}as_text(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatum_as_text(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}}c.exports.TransactionMetadatum=mt;class Je{static __wrap(_){_=_>>>0;const e=Object.create(Je.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionmetadatumlabels_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatumlabels_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionmetadatumlabels_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Je.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionmetadatumlabels_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionmetadatumlabels_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Je.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return Je.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionmetadatumlabels_get(this.__wbg_ptr,_);return I.__wrap(e)}add(_){g(_,I),t.transactionmetadatumlabels_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.TransactionMetadatumLabels=Je;class Yt{static __wrap(_){_=_>>>0;const e=Object.create(Yt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionoutput_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutput_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionoutput_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutput_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionoutput_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutput_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutput_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionoutput_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Yt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}address(){const _=t.transactionoutput_address(this.__wbg_ptr);return pt.__wrap(_)}amount(){const _=t.transactionoutput_amount(this.__wbg_ptr);return gt.__wrap(_)}data_hash(){const _=t.transactionoutput_data_hash(this.__wbg_ptr);return _===0?void 0:U.__wrap(_)}plutus_data(){const _=t.transactionoutput_plutus_data(this.__wbg_ptr);return _===0?void 0:yt.__wrap(_)}script_ref(){const _=t.transactionoutput_script_ref(this.__wbg_ptr);return _===0?void 0:B_.__wrap(_)}set_script_ref(_){g(_,B_),t.transactionoutput_set_script_ref(this.__wbg_ptr,_.__wbg_ptr)}set_plutus_data(_){g(_,yt),t.transactionoutput_set_plutus_data(this.__wbg_ptr,_.__wbg_ptr)}set_data_hash(_){g(_,U),t.transactionoutput_set_data_hash(this.__wbg_ptr,_.__wbg_ptr)}has_plutus_data(){return t.transactionoutput_has_plutus_data(this.__wbg_ptr)!==0}has_data_hash(){return t.transactionoutput_has_data_hash(this.__wbg_ptr)!==0}has_script_ref(){return t.transactionoutput_has_script_ref(this.__wbg_ptr)!==0}static new(_,e){g(_,pt),g(e,gt);const s=t.transactionoutput_new(_.__wbg_ptr,e.__wbg_ptr);return Yt.__wrap(s)}serialization_format(){const _=t.transactionoutput_serialization_format(this.__wbg_ptr);return _===2?void 0:_}}c.exports.TransactionOutput=Yt;class E_{static __wrap(_){_=_>>>0;const e=Object.create(E_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionoutputamountbuilder_free(_)}with_value(_){g(_,gt);const e=t.transactionoutputamountbuilder_with_value(this.__wbg_ptr,_.__wbg_ptr);return E_.__wrap(e)}with_coin(_){g(_,I);const e=t.transactionoutputamountbuilder_with_coin(this.__wbg_ptr,_.__wbg_ptr);return E_.__wrap(e)}with_coin_and_asset(_,e){g(_,I),g(e,$t);const s=t.transactionoutputamountbuilder_with_coin_and_asset(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return E_.__wrap(s)}with_asset_and_min_required_coin(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(_,$t),g(e,I),t.transactionoutputamountbuilder_with_asset_and_min_required_coin(d,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return E_.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}with_asset_and_min_required_coin_by_utxo_cost(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16);g(_,$t),g(e,F),t.transactionoutputamountbuilder_with_asset_and_min_required_coin_by_utxo_cost(d,this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return E_.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}build(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputamountbuilder_build(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return Yt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.TransactionOutputAmountBuilder=E_;class Ke{static __wrap(_){_=_>>>0;const e=Object.create(Ke.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionoutputbuilder_free(_)}static new(){const _=t.transactionoutputbuilder_new();return Ke.__wrap(_)}with_address(_){g(_,pt);const e=t.transactionoutputbuilder_with_address(this.__wbg_ptr,_.__wbg_ptr);return Ke.__wrap(e)}with_data_hash(_){g(_,U);const e=t.transactionoutputbuilder_with_data_hash(this.__wbg_ptr,_.__wbg_ptr);return Ke.__wrap(e)}with_plutus_data(_){g(_,yt);const e=t.transactionoutputbuilder_with_plutus_data(this.__wbg_ptr,_.__wbg_ptr);return Ke.__wrap(e)}with_script_ref(_){g(_,B_);const e=t.transactionoutputbuilder_with_script_ref(this.__wbg_ptr,_.__wbg_ptr);return Ke.__wrap(e)}next(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputbuilder_next(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return E_.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.TransactionOutputBuilder=Ke;class H_{static __wrap(_){_=_>>>0;const e=Object.create(H_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionoutputs_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputs_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionoutputs_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return H_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputs_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionoutputs_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return H_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputs_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionoutputs_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionoutputs_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return H_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return H_.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionoutputs_get(this.__wbg_ptr,_);return Yt.__wrap(e)}add(_){g(_,Yt),t.transactionoutputs_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.TransactionOutputs=H_;class ke{static __wrap(_){_=_>>>0;const e=Object.create(ke.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionunspentoutput_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutput_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionunspentoutput_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ke.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutput_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionunspentoutput_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ke.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutput_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutput_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionunspentoutput_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return ke.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e){g(_,Ct),g(e,Yt);const s=t.transactionunspentoutput_new(_.__wbg_ptr,e.__wbg_ptr);return ke.__wrap(s)}input(){const _=t.transactionunspentoutput_input(this.__wbg_ptr);return Ct.__wrap(_)}output(){const _=t.transactionunspentoutput_output(this.__wbg_ptr);return Yt.__wrap(_)}}c.exports.TransactionUnspentOutput=ke;class We{static __wrap(_){_=_>>>0;const e=Object.create(We.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionunspentoutputs_free(_)}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutputs_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionunspentoutputs_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionunspentoutputs_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return We.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.certificates_new();return We.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionunspentoutputs_get(this.__wbg_ptr,_);return ke.__wrap(e)}add(_){g(_,ke),t.transactionunspentoutputs_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.TransactionUnspentOutputs=We;class y_{static __wrap(_){_=_>>>0;const e=Object.create(y_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionwitnessset_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnessset_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionwitnessset_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return y_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnessset_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionwitnessset_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return y_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnessset_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnessset_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionwitnessset_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return y_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}set_vkeys(_){g(_,je),t.transactionwitnessset_set_vkeys(this.__wbg_ptr,_.__wbg_ptr)}vkeys(){const _=t.transactionwitnessset_vkeys(this.__wbg_ptr);return _===0?void 0:je.__wrap(_)}set_native_scripts(_){g(_,Ht),t.transactionwitnessset_set_native_scripts(this.__wbg_ptr,_.__wbg_ptr)}native_scripts(){const _=t.transactionwitnessset_native_scripts(this.__wbg_ptr);return _===0?void 0:Ht.__wrap(_)}set_bootstraps(_){g(_,x),t.transactionwitnessset_set_bootstraps(this.__wbg_ptr,_.__wbg_ptr)}bootstraps(){const _=t.transactionwitnessset_bootstraps(this.__wbg_ptr);return _===0?void 0:x.__wrap(_)}set_plutus_scripts(_){g(_,x_),t.transactionwitnessset_set_plutus_scripts(this.__wbg_ptr,_.__wbg_ptr)}plutus_scripts(){const _=t.transactionwitnessset_plutus_scripts(this.__wbg_ptr);return _===0?void 0:x_.__wrap(_)}set_plutus_data(_){g(_,a_),t.transactionwitnessset_set_plutus_data(this.__wbg_ptr,_.__wbg_ptr)}plutus_data(){const _=t.transactionwitnessset_plutus_data(this.__wbg_ptr);return _===0?void 0:a_.__wrap(_)}set_redeemers(_){g(_,I_),t.transactionwitnessset_set_redeemers(this.__wbg_ptr,_.__wbg_ptr)}redeemers(){const _=t.transactionwitnessset_redeemers(this.__wbg_ptr);return _===0?void 0:I_.__wrap(_)}static new(){const _=t.transactionwitnessset_new();return y_.__wrap(_)}}c.exports.TransactionWitnessSet=y_;class xe{static __wrap(_){_=_>>>0;const e=Object.create(xe.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_transactionwitnesssets_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnesssets_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.transactionwitnesssets_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return xe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnesssets_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionwitnesssets_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return xe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnesssets_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.transactionwitnesssets_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.transactionwitnesssets_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return xe.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.assetnames_new();return xe.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.transactionwitnesssets_get(this.__wbg_ptr,_);return y_.__wrap(e)}add(_){g(_,y_),t.transactionwitnesssets_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.TransactionWitnessSets=xe;class Qa{__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_txbuilderconstants_free(_)}static plutus_default_cost_models(){const _=t.txbuilderconstants_plutus_default_cost_models();return M.__wrap(_)}static plutus_alonzo_cost_models(){const _=t.txbuilderconstants_plutus_alonzo_cost_models();return M.__wrap(_)}static plutus_vasil_cost_models(){const _=t.txbuilderconstants_plutus_default_cost_models();return M.__wrap(_)}}c.exports.TxBuilderConstants=Qa;class dr{static __wrap(_){_=_>>>0;const e=Object.create(dr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_txinputsbuilder_free(_)}static new(){const _=t.txinputsbuilder_new();return dr.__wrap(_)}add_key_input(_,e,s){g(_,X),g(e,Ct),g(s,gt),t.txinputsbuilder_add_key_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_script_input(_,e,s){g(_,Mt),g(e,Ct),g(s,gt),t.txinputsbuilder_add_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_native_script_input(_,e,s){g(_,Nt),g(e,Ct),g(s,gt),t.txinputsbuilder_add_native_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_plutus_script_input(_,e,s){g(_,l_),g(e,Ct),g(s,gt),t.txinputsbuilder_add_plutus_script_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_bootstrap_input(_,e,s){g(_,A),g(e,Ct),g(s,gt),t.txinputsbuilder_add_bootstrap_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}add_input(_,e,s){g(_,pt),g(e,Ct),g(s,gt),t.txinputsbuilder_add_input(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr,s.__wbg_ptr)}count_missing_input_scripts(){return t.txinputsbuilder_count_missing_input_scripts(this.__wbg_ptr)>>>0}add_required_native_input_scripts(_){return g(_,Ht),t.txinputsbuilder_add_required_native_input_scripts(this.__wbg_ptr,_.__wbg_ptr)>>>0}add_required_plutus_input_scripts(_){return g(_,ne),t.txinputsbuilder_add_required_plutus_input_scripts(this.__wbg_ptr,_.__wbg_ptr)>>>0}add_required_script_input_witnesses(_){return g(_,Et),t.txinputsbuilder_add_required_script_input_witnesses(this.__wbg_ptr,_.__wbg_ptr)>>>0}get_ref_inputs(){const _=t.txinputsbuilder_get_ref_inputs(this.__wbg_ptr);return Lt.__wrap(_)}get_native_input_scripts(){const _=t.txinputsbuilder_get_native_input_scripts(this.__wbg_ptr);return _===0?void 0:Ht.__wrap(_)}get_plutus_input_scripts(){const _=t.txinputsbuilder_get_plutus_input_scripts(this.__wbg_ptr);return _===0?void 0:ne.__wrap(_)}len(){return t.txinputsbuilder_len(this.__wbg_ptr)>>>0}add_required_signer(_){g(_,X),t.txinputsbuilder_add_required_signer(this.__wbg_ptr,_.__wbg_ptr)}add_required_signers(_){g(_,tt),t.txinputsbuilder_add_required_signers(this.__wbg_ptr,_.__wbg_ptr)}total_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.txinputsbuilder_total_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return gt.__wrap(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}inputs(){const _=t.txinputsbuilder_inputs(this.__wbg_ptr);return Lt.__wrap(_)}inputs_option(){const _=t.txinputsbuilder_inputs_option(this.__wbg_ptr);return _===0?void 0:Lt.__wrap(_)}}c.exports.TxInputsBuilder=dr;class Ae{static __wrap(_){_=_>>>0;const e=Object.create(Ae.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_url_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.url_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.url_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.url_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.url_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.dnsrecordaoraaaa_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.url_new(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ae.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}url(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.dnsrecordaoraaaa_record(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}}c.exports.URL=Ae;class zt{static __wrap(_){_=_>>>0;const e=Object.create(zt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_unitinterval_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.unitinterval_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.unitinterval_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.unitinterval_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.unitinterval_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.unitinterval_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.unitinterval_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.unitinterval_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}numerator(){const _=t.exunits_mem(this.__wbg_ptr);return I.__wrap(_)}denominator(){const _=t.exunits_steps(this.__wbg_ptr);return I.__wrap(_)}static new(_,e){g(_,I),g(e,I);const s=t.exunits_new(_.__wbg_ptr,e.__wbg_ptr);return zt.__wrap(s)}}c.exports.UnitInterval=zt;class Ie{static __wrap(_){_=_>>>0;const e=Object.create(Ie.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_update_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.update_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.update_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.update_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.update_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.update_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.update_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.update_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ie.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}proposed_protocol_parameter_updates(){const _=t.update_proposed_protocol_parameter_updates(this.__wbg_ptr);return de.__wrap(_)}epoch(){return t.update_epoch(this.__wbg_ptr)>>>0}static new(_,e){g(_,de);const s=t.update_new(_.__wbg_ptr,e);return Ie.__wrap(s)}}c.exports.Update=Ie;class v_{static __wrap(_){_=_>>>0;const e=Object.create(v_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vrfcert_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vrfcert_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vrfcert_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return v_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.vrfcert_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfcert_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return v_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.vrfcert_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vrfcert_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfcert_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return v_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}output(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.assetname_name(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}proof(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.bootstrapwitness_attributes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e){try{const d=t.__wbindgen_add_to_stack_pointer(-16),o=Q(_,t.__wbindgen_malloc),f=b,l=Q(e,t.__wbindgen_malloc),H=b;t.vrfcert_new(d,o,f,l,H);var s=a()[d/4+0],n=a()[d/4+1],r=a()[d/4+2];if(r)throw p(n);return v_.__wrap(s)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.VRFCert=v_;class q_{static __wrap(_){_=_>>>0;const e=Object.create(q_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vrfkeyhash_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vrfkeyhash_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return q_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfkeyhash_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return q_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfkeyhash_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return q_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.VRFKeyHash=q_;class Ce{static __wrap(_){_=_>>>0;const e=Object.create(Ce.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vrfvkey_free(_)}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vrfvkey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_bech32(_){let e,s;try{const H=t.__wbindgen_add_to_stack_pointer(-16),rt=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),dt=b;t.auxiliarydatahash_to_bech32(H,this.__wbg_ptr,rt,dt);var n=a()[H/4+0],r=a()[H/4+1],d=a()[H/4+2],o=a()[H/4+3],f=n,l=r;if(o)throw f=0,l=0,p(d);return e=f,s=l,m(f,l)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,s,1)}}static from_bech32(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfvkey_from_bech32(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.auxiliarydatahash_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vrfvkey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Ce.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}}c.exports.VRFVKey=Ce;class gt{static __wrap(_){_=_>>>0;const e=Object.create(gt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_value_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.value_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.value_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.value_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.value_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.value_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.value_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.value_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){g(_,I);const e=t.value_new(_.__wbg_ptr);return gt.__wrap(e)}static new_from_assets(_){g(_,$t);const e=t.value_new_from_assets(_.__wbg_ptr);return gt.__wrap(e)}static new_with_assets(_,e){g(_,I),g(e,$t);const s=t.value_new_with_assets(_.__wbg_ptr,e.__wbg_ptr);return gt.__wrap(s)}static zero(){const _=t.value_zero();return gt.__wrap(_)}is_zero(){return t.value_is_zero(this.__wbg_ptr)!==0}coin(){const _=t.value_coin(this.__wbg_ptr);return I.__wrap(_)}set_coin(_){g(_,I),t.value_set_coin(this.__wbg_ptr,_.__wbg_ptr)}multiasset(){const _=t.value_multiasset(this.__wbg_ptr);return _===0?void 0:$t.__wrap(_)}set_multiasset(_){g(_,$t),t.value_set_multiasset(this.__wbg_ptr,_.__wbg_ptr)}checked_add(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,gt),t.value_checked_add(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}checked_sub(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16);g(_,gt),t.value_checked_sub(r,this.__wbg_ptr,_.__wbg_ptr);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return gt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}clamped_sub(_){g(_,gt);const e=t.value_clamped_sub(this.__wbg_ptr,_.__wbg_ptr);return gt.__wrap(e)}compare(_){g(_,gt);const e=t.value_compare(this.__wbg_ptr,_.__wbg_ptr);return e===16777215?void 0:e}}c.exports.Value=gt;class Zt{static __wrap(_){_=_>>>0;const e=Object.create(Zt.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vkey_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkey_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vkey_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.vkey_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkey_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.vkey_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkey_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkey_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return Zt.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_){g(_,u_);const e=t.vkey_new(_.__wbg_ptr);return Zt.__wrap(e)}public_key(){const _=t.vkey_public_key(this.__wbg_ptr);return u_.__wrap(_)}}c.exports.Vkey=Zt;class Nr{static __wrap(_){_=_>>>0;const e=Object.create(Nr.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vkeys_free(_)}static new(){const _=t.ed25519keyhashes_new();return Nr.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.vkeys_get(this.__wbg_ptr,_);return Zt.__wrap(e)}add(_){g(_,Zt),t.vkeys_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.Vkeys=Nr;class R_{static __wrap(_){_=_>>>0;const e=Object.create(R_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vkeywitness_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitness_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vkeywitness_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return R_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitness_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkeywitness_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return R_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitness_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitness_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkeywitness_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return R_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(_,e){g(_,Zt),g(e,it);const s=t.vkeywitness_new(_.__wbg_ptr,e.__wbg_ptr);return R_.__wrap(s)}vkey(){const _=t.vkeywitness_vkey(this.__wbg_ptr);return Zt.__wrap(_)}signature(){const _=t.vkeywitness_signature(this.__wbg_ptr);return it.__wrap(_)}}c.exports.Vkeywitness=R_;class je{static __wrap(_){_=_>>>0;const e=Object.create(je.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_vkeywitnesses_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitnesses_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.vkeywitnesses_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return je.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitnesses_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkeywitnesses_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return je.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitnesses_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.vkeywitnesses_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.vkeywitnesses_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return je.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.ed25519keyhashes_new();return je.__wrap(_)}len(){return t.assetnames_len(this.__wbg_ptr)>>>0}get(_){const e=t.vkeywitnesses_get(this.__wbg_ptr,_);return R_.__wrap(e)}add(_){g(_,R_),t.vkeywitnesses_add(this.__wbg_ptr,_.__wbg_ptr)}}c.exports.Vkeywitnesses=je;class L_{static __wrap(_){_=_>>>0;const e=Object.create(L_.prototype);return e.__wbg_ptr=_,e}__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,_}free(){const _=this.__destroy_into_raw();t.__wbg_withdrawals_free(_)}to_bytes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.withdrawals_to_bytes(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=D(_,e).slice();return t.__wbindgen_free(_,e*1),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_bytes(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=Q(_,t.__wbindgen_malloc),o=b;t.withdrawals_from_bytes(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return L_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_hex(){let _,e;try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.withdrawals_to_hex(r,this.__wbg_ptr);var s=a()[r/4+0],n=a()[r/4+1];return _=s,e=n,m(s,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}static from_hex(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.withdrawals_from_hex(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return L_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}to_json(){let _,e;try{const l=t.__wbindgen_add_to_stack_pointer(-16);t.withdrawals_to_json(l,this.__wbg_ptr);var s=a()[l/4+0],n=a()[l/4+1],r=a()[l/4+2],d=a()[l/4+3],o=s,f=n;if(d)throw o=0,f=0,p(r);return _=o,e=f,m(o,f)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(_,e,1)}}to_js_value(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.withdrawals_to_js_value(n,this.__wbg_ptr);var _=a()[n/4+0],e=a()[n/4+1],s=a()[n/4+2];if(s)throw p(e);return p(_)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static from_json(_){try{const r=t.__wbindgen_add_to_stack_pointer(-16),d=v(_,t.__wbindgen_malloc,t.__wbindgen_realloc),o=b;t.withdrawals_from_json(r,d,o);var e=a()[r/4+0],s=a()[r/4+1],n=a()[r/4+2];if(n)throw p(s);return L_.__wrap(e)}finally{t.__wbindgen_add_to_stack_pointer(16)}}static new(){const _=t.auxiliarydataset_new();return L_.__wrap(_)}len(){return t.auxiliarydataset_len(this.__wbg_ptr)>>>0}insert(_,e){g(_,j_),g(e,I);const s=t.withdrawals_insert(this.__wbg_ptr,_.__wbg_ptr,e.__wbg_ptr);return s===0?void 0:I.__wrap(s)}get(_){g(_,j_);const e=t.withdrawals_get(this.__wbg_ptr,_.__wbg_ptr);return e===0?void 0:I.__wrap(e)}keys(){const _=t.withdrawals_keys(this.__wbg_ptr);return Me.__wrap(_)}}c.exports.Withdrawals=L_,c.exports.__wbindgen_object_drop_ref=function(C){p(C)},c.exports.__wbindgen_string_new=function(C,_){const e=m(C,_);return $(e)},c.exports.__wbindgen_error_new=function(C,_){const e=new Error(m(C,_));return $(e)},c.exports.__wbindgen_string_get=function(C,_){const e=k(_),s=typeof e=="string"?e:void 0;var n=nt(s)?0:v(s,t.__wbindgen_malloc,t.__wbindgen_realloc),r=b;a()[C/4+1]=r,a()[C/4+0]=n},c.exports.__wbindgen_object_clone_ref=function(C){const _=k(C);return $(_)},c.exports.__wbindgen_is_object=function(C){const _=k(C);return typeof _=="object"&&_!==null},c.exports.__wbg_String_91fba7ded13ba54c=function(C,_){const e=String(k(_)),s=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),n=b;a()[C/4+1]=n,a()[C/4+0]=s},c.exports.__wbindgen_number_new=function(C){return $(C)},c.exports.__wbg_set_20cbc34131e76824=function(C,_,e){k(C)[p(_)]=p(e)},c.exports.__wbg_crypto_566d7465cdbb6b7a=function(C){const _=k(C).crypto;return $(_)},c.exports.__wbg_process_dc09a8c7d59982f6=function(C){const _=k(C).process;return $(_)},c.exports.__wbg_versions_d98c6400c6ca2bd8=function(C){const _=k(C).versions;return $(_)},c.exports.__wbg_node_caaf83d002149bd5=function(C){const _=k(C).node;return $(_)},c.exports.__wbindgen_is_string=function(C){return typeof k(C)=="string"},c.exports.__wbg_require_94a9da52636aacbf=function(){return At(function(){return $(en)},arguments)},c.exports.__wbg_msCrypto_0b84745e9245cdf6=function(C){const _=k(C).msCrypto;return $(_)},c.exports.__wbg_randomFillSync_290977693942bf03=function(){return At(function(C,_){k(C).randomFillSync(p(_))},arguments)},c.exports.__wbg_getRandomValues_260cc23a41afad9a=function(){return At(function(C,_){k(C).getRandomValues(k(_))},arguments)},c.exports.__wbindgen_is_function=function(C){return typeof k(C)=="function"},c.exports.__wbg_self_e7c1f827057f6584=function(){return At(function(){const C=self.self;return $(C)},arguments)},c.exports.__wbg_window_a09ec664e14b1b81=function(){return At(function(){const C=window.window;return $(C)},arguments)},c.exports.__wbg_globalThis_87cbb8506fecf3a9=function(){return At(function(){const C=globalThis.globalThis;return $(C)},arguments)},c.exports.__wbg_global_c85a9259e621f3db=function(){return At(function(){const C=zr.global;return $(C)},arguments)},c.exports.__wbindgen_is_undefined=function(C){return k(C)===void 0},c.exports.__wbg_newnoargs_2b8b6bd7753c76ba=function(C,_){const e=new Function(m(C,_));return $(e)},c.exports.__wbg_call_95d1ea488d03e4e8=function(){return At(function(C,_){const e=k(C).call(k(_));return $(e)},arguments)},c.exports.__wbg_new_b525de17f44a8943=function(){const C=new Array;return $(C)},c.exports.__wbg_new_f841cc6f2098f4b5=function(){return $(new Map)},c.exports.__wbg_new_f9876326328f45ed=function(){const C=new Object;return $(C)},c.exports.__wbg_set_17224bc548dd1d7b=function(C,_,e){k(C)[_>>>0]=p(e)},c.exports.__wbg_call_9495de66fdbe016b=function(){return At(function(C,_,e){const s=k(C).call(k(_),k(e));return $(s)},arguments)},c.exports.__wbg_set_388c4c6422704173=function(C,_,e){const s=k(C).set(k(_),k(e));return $(s)},c.exports.__wbg_buffer_cf65c07de34b9a08=function(C){const _=k(C).buffer;return $(_)},c.exports.__wbg_newwithbyteoffsetandlength_9fb2f11355ecadf5=function(C,_,e){const s=new Uint8Array(k(C),_>>>0,e>>>0);return $(s)},c.exports.__wbg_new_537b7341ce90bb31=function(C){const _=new Uint8Array(k(C));return $(_)},c.exports.__wbg_set_17499e8aa4003ebd=function(C,_,e){k(C).set(k(_),e>>>0)},c.exports.__wbg_newwithlength_b56c882b57805732=function(C){const _=new Uint8Array(C>>>0);return $(_)},c.exports.__wbg_subarray_7526649b91a252a6=function(C,_,e){const s=k(C).subarray(_>>>0,e>>>0);return $(s)},c.exports.__wbg_new_d87f272aec784ec0=function(C,_){const e=new Function(m(C,_));return $(e)},c.exports.__wbg_call_eae29933372a39be=function(C,_){const e=k(C).call(k(_));return $(e)},c.exports.__wbindgen_jsval_eq=function(C,_){return k(C)===k(_)},c.exports.__wbg_self_e0b3266d2d9eba1a=function(C){const _=k(C).self;return $(_)},c.exports.__wbg_require_0993fe224bf8e202=function(C,_){const e=en(m(C,_));return $(e)},c.exports.__wbg_crypto_e95a6e54c5c2e37f=function(C){const _=k(C).crypto;return $(_)},c.exports.__wbg_getRandomValues_dc67302a7bd1aec5=function(C){const _=k(C).getRandomValues;return $(_)},c.exports.__wbg_randomFillSync_dd2297de5917c74e=function(C,_,e){k(C).randomFillSync(D(_,e))},c.exports.__wbg_getRandomValues_02639197c8166a96=function(C,_,e){k(C).getRandomValues(D(_,e))},c.exports.__wbindgen_debug_string=function(C,_){const e=Z(k(_)),s=v(e,t.__wbindgen_malloc,t.__wbindgen_realloc),n=b;a()[C/4+1]=n,a()[C/4+0]=s},c.exports.__wbindgen_throw=function(C,_){throw new Error(m(C,_))},c.exports.__wbindgen_memory=function(){const C=t.memory;return $(C)};const Oa=jn.join(__dirname,"sidan_csl_rs_bg.wasm"),Da=jn.readFileSync(Oa),Ta=new WebAssembly.Module(Da);t=new WebAssembly.Instance(Ta,i).exports,c.exports.__wasm=t})(y);const ps=(c,i)=>{const t=y.exports.JsVecString.new();return i.forEach(u=>{t.add(u)}),y.exports.sign_transaction(c,t)},Ze={mem:7e6,steps:3e9},r_={epoch:0,coinsPerUTxOSize:"4310",priceMem:.0577,priceStep:721e-7,minFeeA:44,minFeeB:155381,keyDeposit:"2000000",maxTxSize:16384,maxValSize:"5000",poolDeposit:"500000000",maxCollateralInputs:3,decentralisation:0,maxBlockSize:98304,collateralPercent:150,maxBlockHeaderSize:1100,minPoolCost:"340000000",maxTxExMem:"16000000",maxTxExSteps:"10000000000",maxBlockExMem:"80000000",maxBlockExSteps:"40000000000"},Hr=2147483648,V_={V1:y.exports.Language.new_plutus_v1(),V2:y.exports.Language.new_plutus_v2()},s_=56,Xn={CERT:y.exports.RedeemerTag.new_cert(),MINT:y.exports.RedeemerTag.new_mint(),REWARD:y.exports.RedeemerTag.new_reward(),SPEND:y.exports.RedeemerTag.new_spend()},Ar={testnet:["74","1598400","1595967616","432000"],preview:["183","15811222","1682467200","86400"],preprod:["65","26438400","1682121600","432000"],mainnet:["208","4492800","1596059091","432000"]},nn={ALONZO:y.exports.TxBuilderConstants.plutus_alonzo_cost_models(),BABBAGE:(()=>{const c=y.exports.Costmdls.new(),i=y.exports.CostModel.new();Object.values({"addInteger-cpu-arguments-intercept":205665,"addInteger-cpu-arguments-slope":812,"addInteger-memory-arguments-intercept":1,"addInteger-memory-arguments-slope":1,"appendByteString-cpu-arguments-intercept":1e3,"appendByteString-cpu-arguments-slope":571,"appendByteString-memory-arguments-intercept":0,"appendByteString-memory-arguments-slope":1,"appendString-cpu-arguments-intercept":1e3,"appendString-cpu-arguments-slope":24177,"appendString-memory-arguments-intercept":4,"appendString-memory-arguments-slope":1,"bData-cpu-arguments":1e3,"bData-memory-arguments":32,"blake2b_256-cpu-arguments-intercept":117366,"blake2b_256-cpu-arguments-slope":10475,"blake2b_256-memory-arguments":4,"cekApplyCost-exBudgetCPU":23e3,"cekApplyCost-exBudgetMemory":100,"cekBuiltinCost-exBudgetCPU":23e3,"cekBuiltinCost-exBudgetMemory":100,"cekConstCost-exBudgetCPU":23e3,"cekConstCost-exBudgetMemory":100,"cekDelayCost-exBudgetCPU":23e3,"cekDelayCost-exBudgetMemory":100,"cekForceCost-exBudgetCPU":23e3,"cekForceCost-exBudgetMemory":100,"cekLamCost-exBudgetCPU":23e3,"cekLamCost-exBudgetMemory":100,"cekStartupCost-exBudgetCPU":100,"cekStartupCost-exBudgetMemory":100,"cekVarCost-exBudgetCPU":23e3,"cekVarCost-exBudgetMemory":100,"chooseData-cpu-arguments":19537,"chooseData-memory-arguments":32,"chooseList-cpu-arguments":175354,"chooseList-memory-arguments":32,"chooseUnit-cpu-arguments":46417,"chooseUnit-memory-arguments":4,"consByteString-cpu-arguments-intercept":221973,"consByteString-cpu-arguments-slope":511,"consByteString-memory-arguments-intercept":0,"consByteString-memory-arguments-slope":1,"constrData-cpu-arguments":89141,"constrData-memory-arguments":32,"decodeUtf8-cpu-arguments-intercept":497525,"decodeUtf8-cpu-arguments-slope":14068,"decodeUtf8-memory-arguments-intercept":4,"decodeUtf8-memory-arguments-slope":2,"divideInteger-cpu-arguments-constant":196500,"divideInteger-cpu-arguments-model-arguments-intercept":453240,"divideInteger-cpu-arguments-model-arguments-slope":220,"divideInteger-memory-arguments-intercept":0,"divideInteger-memory-arguments-minimum":1,"divideInteger-memory-arguments-slope":1,"encodeUtf8-cpu-arguments-intercept":1e3,"encodeUtf8-cpu-arguments-slope":28662,"encodeUtf8-memory-arguments-intercept":4,"encodeUtf8-memory-arguments-slope":2,"equalsByteString-cpu-arguments-constant":245e3,"equalsByteString-cpu-arguments-intercept":216773,"equalsByteString-cpu-arguments-slope":62,"equalsByteString-memory-arguments":1,"equalsData-cpu-arguments-intercept":1060367,"equalsData-cpu-arguments-slope":12586,"equalsData-memory-arguments":1,"equalsInteger-cpu-arguments-intercept":208512,"equalsInteger-cpu-arguments-slope":421,"equalsInteger-memory-arguments":1,"equalsString-cpu-arguments-constant":187e3,"equalsString-cpu-arguments-intercept":1e3,"equalsString-cpu-arguments-slope":52998,"equalsString-memory-arguments":1,"fstPair-cpu-arguments":80436,"fstPair-memory-arguments":32,"headList-cpu-arguments":43249,"headList-memory-arguments":32,"iData-cpu-arguments":1e3,"iData-memory-arguments":32,"ifThenElse-cpu-arguments":80556,"ifThenElse-memory-arguments":1,"indexByteString-cpu-arguments":57667,"indexByteString-memory-arguments":4,"lengthOfByteString-cpu-arguments":1e3,"lengthOfByteString-memory-arguments":10,"lessThanByteString-cpu-arguments-intercept":197145,"lessThanByteString-cpu-arguments-slope":156,"lessThanByteString-memory-arguments":1,"lessThanEqualsByteString-cpu-arguments-intercept":197145,"lessThanEqualsByteString-cpu-arguments-slope":156,"lessThanEqualsByteString-memory-arguments":1,"lessThanEqualsInteger-cpu-arguments-intercept":204924,"lessThanEqualsInteger-cpu-arguments-slope":473,"lessThanEqualsInteger-memory-arguments":1,"lessThanInteger-cpu-arguments-intercept":208896,"lessThanInteger-cpu-arguments-slope":511,"lessThanInteger-memory-arguments":1,"listData-cpu-arguments":52467,"listData-memory-arguments":32,"mapData-cpu-arguments":64832,"mapData-memory-arguments":32,"mkCons-cpu-arguments":65493,"mkCons-memory-arguments":32,"mkNilData-cpu-arguments":22558,"mkNilData-memory-arguments":32,"mkNilPairData-cpu-arguments":16563,"mkNilPairData-memory-arguments":32,"mkPairData-cpu-arguments":76511,"mkPairData-memory-arguments":32,"modInteger-cpu-arguments-constant":196500,"modInteger-cpu-arguments-model-arguments-intercept":453240,"modInteger-cpu-arguments-model-arguments-slope":220,"modInteger-memory-arguments-intercept":0,"modInteger-memory-arguments-minimum":1,"modInteger-memory-arguments-slope":1,"multiplyInteger-cpu-arguments-intercept":69522,"multiplyInteger-cpu-arguments-slope":11687,"multiplyInteger-memory-arguments-intercept":0,"multiplyInteger-memory-arguments-slope":1,"nullList-cpu-arguments":60091,"nullList-memory-arguments":32,"quotientInteger-cpu-arguments-constant":196500,"quotientInteger-cpu-arguments-model-arguments-intercept":453240,"quotientInteger-cpu-arguments-model-arguments-slope":220,"quotientInteger-memory-arguments-intercept":0,"quotientInteger-memory-arguments-minimum":1,"quotientInteger-memory-arguments-slope":1,"remainderInteger-cpu-arguments-constant":196500,"remainderInteger-cpu-arguments-model-arguments-intercept":453240,"remainderInteger-cpu-arguments-model-arguments-slope":220,"remainderInteger-memory-arguments-intercept":0,"remainderInteger-memory-arguments-minimum":1,"remainderInteger-memory-arguments-slope":1,"sha2_256-cpu-arguments-intercept":806990,"sha2_256-cpu-arguments-slope":30482,"sha2_256-memory-arguments":4,"sha3_256-cpu-arguments-intercept":1927926,"sha3_256-cpu-arguments-slope":82523,"sha3_256-memory-arguments":4,"sliceByteString-cpu-arguments-intercept":265318,"sliceByteString-cpu-arguments-slope":0,"sliceByteString-memory-arguments-intercept":4,"sliceByteString-memory-arguments-slope":0,"sndPair-cpu-arguments":85931,"sndPair-memory-arguments":32,"subtractInteger-cpu-arguments-intercept":205665,"subtractInteger-cpu-arguments-slope":812,"subtractInteger-memory-arguments-intercept":1,"subtractInteger-memory-arguments-slope":1,"tailList-cpu-arguments":41182,"tailList-memory-arguments":32,"trace-cpu-arguments":212342,"trace-memory-arguments":32,"unBData-cpu-arguments":31220,"unBData-memory-arguments":32,"unConstrData-cpu-arguments":32696,"unConstrData-memory-arguments":32,"unIData-cpu-arguments":43357,"unIData-memory-arguments":32,"unListData-cpu-arguments":32247,"unListData-memory-arguments":32,"unMapData-cpu-arguments":38314,"unMapData-memory-arguments":32,"verifyEd25519Signature-cpu-arguments-intercept":57996947,"verifyEd25519Signature-cpu-arguments-slope":18975,"verifyEd25519Signature-memory-arguments":10}).forEach((w,u)=>i.set(u,y.exports.Int.new_i32(w)));const t=y.exports.CostModel.new();return Object.values({"addInteger-cpu-arguments-intercept":205665,"addInteger-cpu-arguments-slope":812,"addInteger-memory-arguments-intercept":1,"addInteger-memory-arguments-slope":1,"appendByteString-cpu-arguments-intercept":1e3,"appendByteString-cpu-arguments-slope":571,"appendByteString-memory-arguments-intercept":0,"appendByteString-memory-arguments-slope":1,"appendString-cpu-arguments-intercept":1e3,"appendString-cpu-arguments-slope":24177,"appendString-memory-arguments-intercept":4,"appendString-memory-arguments-slope":1,"bData-cpu-arguments":1e3,"bData-memory-arguments":32,"blake2b_256-cpu-arguments-intercept":117366,"blake2b_256-cpu-arguments-slope":10475,"blake2b_256-memory-arguments":4,"cekApplyCost-exBudgetCPU":23e3,"cekApplyCost-exBudgetMemory":100,"cekBuiltinCost-exBudgetCPU":23e3,"cekBuiltinCost-exBudgetMemory":100,"cekConstCost-exBudgetCPU":23e3,"cekConstCost-exBudgetMemory":100,"cekDelayCost-exBudgetCPU":23e3,"cekDelayCost-exBudgetMemory":100,"cekForceCost-exBudgetCPU":23e3,"cekForceCost-exBudgetMemory":100,"cekLamCost-exBudgetCPU":23e3,"cekLamCost-exBudgetMemory":100,"cekStartupCost-exBudgetCPU":100,"cekStartupCost-exBudgetMemory":100,"cekVarCost-exBudgetCPU":23e3,"cekVarCost-exBudgetMemory":100,"chooseData-cpu-arguments":19537,"chooseData-memory-arguments":32,"chooseList-cpu-arguments":175354,"chooseList-memory-arguments":32,"chooseUnit-cpu-arguments":46417,"chooseUnit-memory-arguments":4,"consByteString-cpu-arguments-intercept":221973,"consByteString-cpu-arguments-slope":511,"consByteString-memory-arguments-intercept":0,"consByteString-memory-arguments-slope":1,"constrData-cpu-arguments":89141,"constrData-memory-arguments":32,"decodeUtf8-cpu-arguments-intercept":497525,"decodeUtf8-cpu-arguments-slope":14068,"decodeUtf8-memory-arguments-intercept":4,"decodeUtf8-memory-arguments-slope":2,"divideInteger-cpu-arguments-constant":196500,"divideInteger-cpu-arguments-model-arguments-intercept":453240,"divideInteger-cpu-arguments-model-arguments-slope":220,"divideInteger-memory-arguments-intercept":0,"divideInteger-memory-arguments-minimum":1,"divideInteger-memory-arguments-slope":1,"encodeUtf8-cpu-arguments-intercept":1e3,"encodeUtf8-cpu-arguments-slope":28662,"encodeUtf8-memory-arguments-intercept":4,"encodeUtf8-memory-arguments-slope":2,"equalsByteString-cpu-arguments-constant":245e3,"equalsByteString-cpu-arguments-intercept":216773,"equalsByteString-cpu-arguments-slope":62,"equalsByteString-memory-arguments":1,"equalsData-cpu-arguments-intercept":1060367,"equalsData-cpu-arguments-slope":12586,"equalsData-memory-arguments":1,"equalsInteger-cpu-arguments-intercept":208512,"equalsInteger-cpu-arguments-slope":421,"equalsInteger-memory-arguments":1,"equalsString-cpu-arguments-constant":187e3,"equalsString-cpu-arguments-intercept":1e3,"equalsString-cpu-arguments-slope":52998,"equalsString-memory-arguments":1,"fstPair-cpu-arguments":80436,"fstPair-memory-arguments":32,"headList-cpu-arguments":43249,"headList-memory-arguments":32,"iData-cpu-arguments":1e3,"iData-memory-arguments":32,"ifThenElse-cpu-arguments":80556,"ifThenElse-memory-arguments":1,"indexByteString-cpu-arguments":57667,"indexByteString-memory-arguments":4,"lengthOfByteString-cpu-arguments":1e3,"lengthOfByteString-memory-arguments":10,"lessThanByteString-cpu-arguments-intercept":197145,"lessThanByteString-cpu-arguments-slope":156,"lessThanByteString-memory-arguments":1,"lessThanEqualsByteString-cpu-arguments-intercept":197145,"lessThanEqualsByteString-cpu-arguments-slope":156,"lessThanEqualsByteString-memory-arguments":1,"lessThanEqualsInteger-cpu-arguments-intercept":204924,"lessThanEqualsInteger-cpu-arguments-slope":473,"lessThanEqualsInteger-memory-arguments":1,"lessThanInteger-cpu-arguments-intercept":208896,"lessThanInteger-cpu-arguments-slope":511,"lessThanInteger-memory-arguments":1,"listData-cpu-arguments":52467,"listData-memory-arguments":32,"mapData-cpu-arguments":64832,"mapData-memory-arguments":32,"mkCons-cpu-arguments":65493,"mkCons-memory-arguments":32,"mkNilData-cpu-arguments":22558,"mkNilData-memory-arguments":32,"mkNilPairData-cpu-arguments":16563,"mkNilPairData-memory-arguments":32,"mkPairData-cpu-arguments":76511,"mkPairData-memory-arguments":32,"modInteger-cpu-arguments-constant":196500,"modInteger-cpu-arguments-model-arguments-intercept":453240,"modInteger-cpu-arguments-model-arguments-slope":220,"modInteger-memory-arguments-intercept":0,"modInteger-memory-arguments-minimum":1,"modInteger-memory-arguments-slope":1,"multiplyInteger-cpu-arguments-intercept":69522,"multiplyInteger-cpu-arguments-slope":11687,"multiplyInteger-memory-arguments-intercept":0,"multiplyInteger-memory-arguments-slope":1,"nullList-cpu-arguments":60091,"nullList-memory-arguments":32,"quotientInteger-cpu-arguments-constant":196500,"quotientInteger-cpu-arguments-model-arguments-intercept":453240,"quotientInteger-cpu-arguments-model-arguments-slope":220,"quotientInteger-memory-arguments-intercept":0,"quotientInteger-memory-arguments-minimum":1,"quotientInteger-memory-arguments-slope":1,"remainderInteger-cpu-arguments-constant":196500,"remainderInteger-cpu-arguments-model-arguments-intercept":453240,"remainderInteger-cpu-arguments-model-arguments-slope":220,"remainderInteger-memory-arguments-intercept":0,"remainderInteger-memory-arguments-minimum":1,"remainderInteger-memory-arguments-slope":1,"serialiseData-cpu-arguments-intercept":1159724,"serialiseData-cpu-arguments-slope":392670,"serialiseData-memory-arguments-intercept":0,"serialiseData-memory-arguments-slope":2,"sha2_256-cpu-arguments-intercept":806990,"sha2_256-cpu-arguments-slope":30482,"sha2_256-memory-arguments":4,"sha3_256-cpu-arguments-intercept":1927926,"sha3_256-cpu-arguments-slope":82523,"sha3_256-memory-arguments":4,"sliceByteString-cpu-arguments-intercept":265318,"sliceByteString-cpu-arguments-slope":0,"sliceByteString-memory-arguments-intercept":4,"sliceByteString-memory-arguments-slope":0,"sndPair-cpu-arguments":85931,"sndPair-memory-arguments":32,"subtractInteger-cpu-arguments-intercept":205665,"subtractInteger-cpu-arguments-slope":812,"subtractInteger-memory-arguments-intercept":1,"subtractInteger-memory-arguments-slope":1,"tailList-cpu-arguments":41182,"tailList-memory-arguments":32,"trace-cpu-arguments":212342,"trace-memory-arguments":32,"unBData-cpu-arguments":31220,"unBData-memory-arguments":32,"unConstrData-cpu-arguments":32696,"unConstrData-memory-arguments":32,"unIData-cpu-arguments":43357,"unIData-memory-arguments":32,"unListData-cpu-arguments":32247,"unListData-memory-arguments":32,"unMapData-cpu-arguments":38314,"unMapData-memory-arguments":32,"verifyEcdsaSecp256k1Signature-cpu-arguments":35892428,"verifyEcdsaSecp256k1Signature-memory-arguments":10,"verifyEd25519Signature-cpu-arguments-intercept":57996947,"verifyEd25519Signature-cpu-arguments-slope":18975,"verifyEd25519Signature-memory-arguments":10,"verifySchnorrSecp256k1Signature-cpu-arguments-intercept":38887044,"verifySchnorrSecp256k1Signature-cpu-arguments-slope":32947,"verifySchnorrSecp256k1Signature-memory-arguments":10}).forEach((w,u)=>t.set(u,y.exports.Int.new_i32(w))),c.insert(y.exports.Language.new_plutus_v1(),i),c.insert(y.exports.Language.new_plutus_v2(),t),c})()},Zn={ALONZO:{V1:"a141005901d59f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f704001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff"},BABBAGE:{V1:"a141005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff",V2:"a20198af1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201b00000004a817c8001b00000004a817c8001a009063b91903fd0a1b00000004a817c800001b00000004a817c80041005901b69f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a009063b91903fd0aff"}},Wr={[y.exports.NetworkInfo.testnet().network_id()]:"8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3",[y.exports.NetworkInfo.mainnet().network_id()]:"f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a"},ta={mainnet:"wss://ogmios-api.mainnet.dandelion.link",preprod:"wss://ogmios-api.iohk-preprod.dandelion.link",preview:"__TBD_SOON_TM__",testnet:"wss://ogmios-api.testnet.dandelion.link"},_a={LQ:"da8c30857834c6ae7203935b89278c532b3995245295456f993e1d244c51",MIN:"29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e",NTX:"edfd7a1d77bcb8b884c474bdc92a16002d1fb720e454fa6e993444794e5458",iBTC:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069425443",iETH:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069455448",iUSD:"f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b6988069555344",MILK:"8a1cfae21368b8bebbbed9800fec304e95cce39a2a57dc35e2e3ebaa4d494c4b",AGIX:"f43a62fdc3965df486de8a0d32fe800963589c41b38946602a0dc53541474958",MELD:"6ac8ef33b510ec004fe11585f7c5a9f0c07f0c23428ab4f29c1d7d104d454c44",INDY:"533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0494e4459",CLAY:"38ad9dc3aec6a2f38e220142b9aa6ade63ebe71f65e7cc2b7d8a8535434c4159",MCOS:"6f46e1304b16d884c85c62fb0eef35028facdc41aaa0fd319a152ed64d434f53",DING:"ce5b9e0f8a88255b65f2e4d065c6e716e9fa9a8a86dfb86423dd1ac044494e47",GERO:"10a49b996e2402269af553a8a96fb8eb90d79e9eca79e2b4223057b64745524f",NMKR:"5dac8536653edc12f6f5e1045d8164b9f59998d3bdc300fc928434894e4d4b52",PAVIA:"884892bcdc360bcef87d6b3f806e7f9cd5ac30d999d49970e7a903ae5041564941",HOSKY:"a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235484f534b59",YUMMI:"078eafce5cd7edafdf63900edef2c1ea759e77f30ca81d6bbdeec92479756d6d69",C3:"8e51398904a5d3fc129fbf4f1589701de23c7824d5c90fdb9490e15a434841524c4933",GIMBAL:"2b0a04a7b60132b1805b296c7fcb3b217ff14413991bf76f72663c3067696d62616c",SUNDAE:"9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d7753554e444145",GREENS:"4623ab311b7d982d8d26fcbe1a9439ca56661aafcdcd8d8a0ef31fd6475245454e53",GENS:"dda5fdb1002f7389b33e036b6afee82a8189becb6cba852e8b79b4fb0014df1047454e53",SOCIETY:"25f0fc240e91bd95dcdaebd2ba7713fc5168ac77234a3d79449fc20c534f4349455459",DJED:"8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd61446a65644d6963726f555344",SHEN:"8db269c3ec630e06ae29f74bc39edd1f87c819f1056206e879a1cd615368656e4d6963726f555344",WMT:"1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e776f726c646d6f62696c65746f6b656e",COPI:"b6a7467ea1deb012808ef4e87b5ff371e85f7142d7b356a40d9b42a0436f726e75636f70696173205b76696120436861696e506f72742e696f5d"},an=["begin","eternl","flint","lace","nami","nufi","gerowallet","typhoncip30","vespr","yoroi"],ea=(c,i,t="5000000")=>{const w=y.exports.BigNum.from_str(c.get("lovelace")??"0").checked_add(y.exports.BigNum.from_str(t)),u=i.filter(j=>j.output.amount.filter(P=>P.unit!=="lovelace").some(P=>c.has(P.unit))),h=us(u);return[...h.less_than(w)?bs(w.clamped_sub(h).to_str(),i.filter(j=>!u.some(P=>P.input.txHash===j.input.txHash&&P.input.outputIndex===j.input.outputIndex))):[],...u]},ws=(c,i,t=!1,{maxTxSize:w,minFeeA:u,minFeeB:h}=r_)=>{const k=i.filter(G=>na(G)===!1).sort(fn),j=y.exports.BigNum.from_str(In(w,u,h)),P=t?y.exports.BigNum.from_str(c).checked_add(j).to_str():c;return Ir(k,new Map([["lovelace",P]]))},ra=(c,i,t=!1,w=r_)=>{const u=i.filter(na).sort(fn),h=gs(w),k=c.get("lovelace")??"0",j=t?y.exports.BigNum.from_str(k).checked_add(h).to_str():k;return c.set("lovelace",j),Ir(u,c)},ls=(c,i)=>Array.from(i,t=>({unit:t[0],quantity:y.exports.BigNum.from_str(t[1])})).every(t=>c.filter(w=>w.output.amount.find(u=>u.unit===t.unit)!==void 0).reduce((w,u)=>{const h=u.output.amount.reduce((k,j)=>k.checked_add(y.exports.BigNum.from_str(t.unit===j.unit?j.quantity:"0")),y.exports.BigNum.from_str("0"));return w.checked_add(h)},y.exports.BigNum.from_str("0")).less_than(t.quantity)===!1),fn=(c,i)=>{var u,h;const t=y.exports.BigNum.from_str(((u=c.output.amount.find(k=>k.unit==="lovelace"))==null?void 0:u.quantity)??"0");return y.exports.BigNum.from_str(((h=i.output.amount.find(k=>k.unit==="lovelace"))==null?void 0:h.quantity)??"0").compare(t)},gs=c=>{const{maxTxSize:i,minFeeA:t,minFeeB:w}=c;return y.exports.BigNum.from_str(In(i,t,w))},na=c=>c.output.amount.length>1,us=c=>c.reduce((i,t)=>{var u;const w=((u=t.output.amount.find(h=>h.unit==="lovelace"))==null?void 0:u.quantity)??"0";return i.checked_add(y.exports.BigNum.from_str(w))},y.exports.BigNum.from_str("0")),bs=(c,i)=>{const t=i.sort(fn);return Ir(t,new Map([["lovelace",c]]))},Ir=(c,i,t=[])=>c.length===0||ls(t,i)?t:fs(c[0],i)?Ir(c.slice(1),i,[...t,c[0]]):Ir(c.slice(1),i,t),fs=(c,i)=>Array.from(i.keys()).some(t=>c.output.amount.find(w=>w.unit===t)!==void 0),hs=(c,i)=>{const t=ms(i),w=ks(c,i);return{coseKey:c_(t.to_bytes()),coseSign1:c_(w.to_bytes())}},ys=(c,i,{key:t,signature:w})=>{var k,j;const u=jt.COSEKey.from_bytes(kt(t)),h=jt.COSESign1.from_bytes(kt(w));if((c==null?void 0:c.length)>0){const P=c_(h.payload()??new Uint8Array);if(p_(c)!==P)return!1}if((i==null?void 0:i.length)>0){const p=(k=h.headers().protected().deserialized_headers().header(jt.Label.new_text("address")))==null?void 0:k.as_bytes();if(p===void 0)throw new Error("Couldn't find a signer address in signature");const V=(j=u.header(jt.Label.new_int(jt.Int.new_negative(jt.BigNum.from_str("2")))))==null?void 0:j.as_bytes();if(V===void 0)throw new Error("Couldn't find a signer key in signature");const G=cr(c_(p)),R=Ys(c_(V));if(vs(i,G,R)===!1)throw new Error("Couldn't check signature because of address mismatch");const m=Gs(c_(h.signature())),$=h.signed_data().to_bytes();return R.verify($,m)}return!1},vs=(c,i,t)=>{if(c!==i.to_bech32())return!1;try{return pr(c)===t.hash().to_hex()}catch{return!1}},ms=c=>{const i=jt.COSEKey.new(jt.Label.from_key_type(jt.KeyType.OKP));return i.set_algorithm_id(jt.Label.from_algorithm_id(jt.AlgorithmId.EdDSA)),i.set_header(jt.Label.new_int(jt.Int.new_negative(jt.BigNum.from_str("1"))),jt.CBORValue.new_int(jt.Int.new_i32(6))),i.set_header(jt.Label.new_int(jt.Int.new_negative(jt.BigNum.from_str("2"))),jt.CBORValue.new_bytes(c.key.to_public().as_bytes())),i},ks=(c,i)=>{const t=jt.HeaderMap.new(),w=jt.HeaderMap.new();t.set_algorithm_id(jt.Label.from_algorithm_id(jt.AlgorithmId.EdDSA)),t.set_header(jt.Label.new_text("address"),jt.CBORValue.new_bytes(i.address.to_bytes()));const u=jt.Headers.new(jt.ProtectedHeaderMap.new(t),w),h=jt.COSESign1Builder.new(u,kt(c.payload),!1);c.externalAAD!==void 0&&h.set_external_aad(kt(c.externalAAD));const k=h.make_data_to_sign(),j=i.key.sign(k.to_bytes());return h.build(j.to_bytes())};var aa={},o_={exports:{}};Se.notEqual=As;Se.notOk=Is;Se.equal=xs;Se.ok=Se;var sa=Se;function xs(c,i,t){Se(c==i,t)}function As(c,i,t){Se(c!=i,t)}function Is(c,i){Se(!c,i)}function Se(c,i){if(!c)throw new Error(i||"AssertionError")}var $_={exports:{}},Cs=hn;hn.supported=typeof WebAssembly<"u";function hn(c){if(!hn.supported)return null;var i=c&&c.imports,t=js("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBx8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAZfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgHXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBF8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAWfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgE3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIICB8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAefHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgG3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB98fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAUfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgF3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBh8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCASfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBV8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAYfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgGnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBR8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiASfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB18fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAcfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggH3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBN8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAXfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgFnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBt8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAVfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggEXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFICB8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAZfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgGnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBF8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAWfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBN8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAVfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggG3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIICB8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAffHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBx8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAdfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggF3x8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBl8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAUfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgHnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBN8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAdfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgF3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBt8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByARfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBl8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAUfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgFXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB58fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAYfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFnx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIICB8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAffHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgEnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBp8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAdfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgFnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBJ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAgfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgH3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB58fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAVfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggG3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBF8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAYfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgF3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBR8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAafHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggE3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBl8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAcfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBx8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAYfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgH3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIB18fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByASfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggFHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBp8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAWfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHICB8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAVfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBd8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSATfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgG3x8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBd8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAgfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgH3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBp8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAcfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBF8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAZfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgHXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBN8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAefHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgGHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBJ8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAVfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgG3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBZ8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAbfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgE3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBl8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAVfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGHx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBd8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCASfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggFnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGICB8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAcfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgGnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB98fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAUfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB58fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSARfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgEXx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBJ8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiATfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgFHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBV8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAWfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggF3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBh8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAZfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgGnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBt8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAcfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB58fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAffHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgIHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB98fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAbfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBl8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAafHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgIHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIB58fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAXfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEnx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB18fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL"),w=null,u={buffer:t,memory:null,exports:null,realloc:h,onload:k};return k(function(){}),u;function h(P){u.exports.memory.grow(Math.ceil(Math.abs(P-u.memory.length)/65536)),u.memory=new Uint8Array(u.exports.memory.buffer)}function k(P){if(u.exports)return P();if(w){w.then(P.bind(null,null)).catch(P);return}try{if(c&&c.async)throw new Error("async");j({instance:new WebAssembly.Instance(new WebAssembly.Module(t),i)})}catch{w=WebAssembly.instantiate(t,i).then(j)}k(P)}function j(P){u.exports=P.instance.exports,u.memory=u.exports.memory&&u.exports.memory.buffer&&new Uint8Array(u.exports.memory.buffer)}}function js(c){return typeof atob=="function"?new Uint8Array(atob(c).split("").map(Bs)):new(en("buffer")).Buffer(c,"base64")}function Bs(c){return c.charCodeAt(0)}var z_=sa,Tt=Cs(),Be=64,qr=[];$_.exports=k_;var Bn=$_.exports.BYTES_MIN=16,En=$_.exports.BYTES_MAX=64;$_.exports.BYTES=32;var Sn=$_.exports.KEYBYTES_MIN=16,Qn=$_.exports.KEYBYTES_MAX=64;$_.exports.KEYBYTES=32;var On=$_.exports.SALTBYTES=16,Dn=$_.exports.PERSONALBYTES=16;function k_(c,i,t,w,u){if(!(this instanceof k_))return new k_(c,i,t,w,u);if(!(Tt&&Tt.exports))throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");c||(c=32),u!==!0&&(z_(c>=Bn,"digestLength must be at least "+Bn+", was given "+c),z_(c<=En,"digestLength must be at most "+En+", was given "+c),i!=null&&z_(i.length>=Sn,"key must be at least "+Sn+", was given "+i.length),i!=null&&z_(i.length<=Qn,"key must be at least "+Qn+", was given "+i.length),t!=null&&z_(t.length===On,"salt must be exactly "+On+", was given "+t.length),w!=null&&z_(w.length===Dn,"personal must be exactly "+Dn+", was given "+w.length)),qr.length||(qr.push(Be),Be+=216),this.digestLength=c,this.finalized=!1,this.pointer=qr.pop(),Tt.memory.fill(0,0,64),Tt.memory[0]=this.digestLength,Tt.memory[1]=i?i.length:0,Tt.memory[2]=1,Tt.memory[3]=1,t&&Tt.memory.set(t,32),w&&Tt.memory.set(w,48),this.pointer+216>Tt.memory.length&&Tt.realloc(this.pointer+216),Tt.exports.blake2b_init(this.pointer,this.digestLength),i&&(this.update(i),Tt.memory.fill(0,Be,Be+i.length),Tt.memory[this.pointer+200]=128)}k_.prototype.update=function(c){return z_(this.finalized===!1,"Hash instance finalized"),z_(c,"input must be TypedArray or Buffer"),Be+c.length>Tt.memory.length&&Tt.realloc(Be+c.length),Tt.memory.set(c,Be),Tt.exports.blake2b_update(this.pointer,Be,Be+c.length),this};k_.prototype.digest=function(c){if(z_(this.finalized===!1,"Hash instance finalized"),this.finalized=!0,qr.push(this.pointer),Tt.exports.blake2b_final(this.pointer),!c||c==="binary")return Tt.memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if(c==="hex")return Ss(Tt.memory,this.pointer+128,this.digestLength);z_(c.length>=this.digestLength,"input must be TypedArray or Buffer");for(var i=0;i<this.digestLength;i++)c[i]=Tt.memory[this.pointer+128+i];return c};k_.prototype.final=k_.prototype.digest;k_.WASM=Tt&&Tt.buffer;k_.SUPPORTED=typeof WebAssembly<"u";k_.ready=function(c){if(c||(c=Es),!Tt)return c(new Error("WebAssembly not supported"));var i=new Promise(function(t,w){Tt.onload(function(u){u?w():t(),c(u)})});return i};k_.prototype.ready=k_.ready;function Es(){}function Ss(c,i,t){for(var w="",u=0;u<t;u++)w+=Qs(c[i+u]);return w}function Qs(c){return c<16?"0"+c.toString(16):c.toString(16)}var Re=sa,Cr=$_.exports;function Ur(c,i,t){var w=c[i]+c[t],u=c[i+1]+c[t+1];w>=4294967296&&u++,c[i]=w,c[i+1]=u}function Tn(c,i,t,w){var u=c[i]+t;t<0&&(u+=4294967296);var h=c[i+1]+w;u>=4294967296&&h++,c[i]=u,c[i+1]=h}function oa(c,i){return c[i]^c[i+1]<<8^c[i+2]<<16^c[i+3]<<24}function He(c,i,t,w,u,h){var k=kr[u],j=kr[u+1],P=kr[h],p=kr[h+1];Ur(lt,c,i),Tn(lt,c,k,j);var V=lt[w]^lt[c],G=lt[w+1]^lt[c+1];lt[w]=G,lt[w+1]=V,Ur(lt,t,w),V=lt[i]^lt[t],G=lt[i+1]^lt[t+1],lt[i]=V>>>24^G<<8,lt[i+1]=G>>>24^V<<8,Ur(lt,c,i),Tn(lt,c,P,p),V=lt[w]^lt[c],G=lt[w+1]^lt[c+1],lt[w]=V>>>16^G<<16,lt[w+1]=G>>>16^V<<16,Ur(lt,t,w),V=lt[i]^lt[t],G=lt[i+1]^lt[t+1],lt[i]=G>>>31^V<<1,lt[i+1]=V>>>31^G<<1}var ia=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Os=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],t_=new Uint8Array(Os.map(function(c){return c*2})),lt=new Uint32Array(32),kr=new Uint32Array(32);function da(c,i){var t=0;for(t=0;t<16;t++)lt[t]=c.h[t],lt[t+16]=ia[t];for(lt[24]=lt[24]^c.t,lt[25]=lt[25]^c.t/4294967296,i&&(lt[28]=~lt[28],lt[29]=~lt[29]),t=0;t<32;t++)kr[t]=oa(c.b,4*t);for(t=0;t<12;t++)He(0,8,16,24,t_[t*16+0],t_[t*16+1]),He(2,10,18,26,t_[t*16+2],t_[t*16+3]),He(4,12,20,28,t_[t*16+4],t_[t*16+5]),He(6,14,22,30,t_[t*16+6],t_[t*16+7]),He(0,10,20,30,t_[t*16+8],t_[t*16+9]),He(2,12,22,24,t_[t*16+10],t_[t*16+11]),He(4,14,16,26,t_[t*16+12],t_[t*16+13]),He(6,8,18,28,t_[t*16+14],t_[t*16+15]);for(t=0;t<16;t++)c.h[t]=c.h[t]^lt[t]^lt[t+16]}var qe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function gr(c,i,t,w){qe.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=c,qe[0]=c,i&&(qe[1]=i.length),qe[2]=1,qe[3]=1,t&&qe.set(t,32),w&&qe.set(w,48);for(var u=0;u<16;u++)this.h[u]=ia[u]^oa(qe,u*4);i&&(ca(this,i),this.c=128)}gr.prototype.update=function(c){return Re(c!=null,"input must be Uint8Array or Buffer"),ca(this,c),this};gr.prototype.digest=function(c){var i=!c||c==="binary"||c==="hex"?new Uint8Array(this.outlen):c;return Re(i.length>=this.outlen,"out must have at least outlen bytes of space"),Ds(this,i),c==="hex"?Ts(i):i};gr.prototype.final=gr.prototype.digest;gr.ready=function(c){Cr.ready(function(){c()})};function ca(c,i){for(var t=0;t<i.length;t++)c.c===128&&(c.t+=c.c,da(c,!1),c.c=0),c.b[c.c++]=i[t]}function Ds(c,i){for(c.t+=c.c;c.c<128;)c.b[c.c++]=0;da(c,!0);for(var t=0;t<c.outlen;t++)i[t]=c.h[t>>2]>>8*(t&3);return i}function Ts(c){for(var i="",t=0;t<c.length;t++)i+=Ns(c[t]);return i}function Ns(c){return c<16?"0"+c.toString(16):c.toString(16)}var pa=gr;o_.exports=function(i,t,w,u,h){return h!==!0&&(Re(i>=Nn,"outlen must be at least "+Nn+", was given "+i),Re(i<=Un,"outlen must be at most "+Un+", was given "+i),t!=null&&Re(t.length>=Pn,"key must be at least "+Pn+", was given "+t.length),t!=null&&Re(t.length<=Mn,"key must be at most "+Mn+", was given "+t.length),w!=null&&Re(w.length===Fn,"salt must be exactly "+Fn+", was given "+w.length),u!=null&&Re(u.length===Kn,"personal must be exactly "+Kn+", was given "+u.length)),new pa(i,t,w,u)};o_.exports.ready=function(c){Cr.ready(function(){c()})};o_.exports.WASM_SUPPORTED=Cr.SUPPORTED;o_.exports.WASM_LOADED=!1;var Nn=o_.exports.BYTES_MIN=16,Un=o_.exports.BYTES_MAX=64;o_.exports.BYTES=32;var Pn=o_.exports.KEYBYTES_MIN=16,Mn=o_.exports.KEYBYTES_MAX=64;o_.exports.KEYBYTES=32;var Fn=o_.exports.SALTBYTES=16,Kn=o_.exports.PERSONALBYTES=16;Cr.ready(function(c){c||(o_.exports.WASM_LOADED=!0,pa=Cr)});var ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.bech32m=ur.bech32=void 0;const Vr="qpzry9x8gf2tvdw0s3jn54khce6mua7l",wa={};for(let c=0;c<Vr.length;c++){const i=Vr.charAt(c);wa[i]=c}function lr(c){const i=c>>25;return(c&33554431)<<5^-(i>>0&1)&996825010^-(i>>1&1)&642813549^-(i>>2&1)&513874426^-(i>>3&1)&1027748829^-(i>>4&1)&705979059}function Hn(c){let i=1;for(let t=0;t<c.length;++t){const w=c.charCodeAt(t);if(w<33||w>126)return"Invalid prefix ("+c+")";i=lr(i)^w>>5}i=lr(i);for(let t=0;t<c.length;++t){const w=c.charCodeAt(t);i=lr(i)^w&31}return i}function yn(c,i,t,w){let u=0,h=0;const k=(1<<t)-1,j=[];for(let P=0;P<c.length;++P)for(u=u<<i|c[P],h+=i;h>=t;)h-=t,j.push(u>>h&k);if(w)h>0&&j.push(u<<t-h&k);else{if(h>=i)return"Excess padding";if(u<<t-h&k)return"Non-zero padding"}return j}function Us(c){return yn(c,8,5,!0)}function Ps(c){const i=yn(c,5,8,!1);if(Array.isArray(i))return i}function Ms(c){const i=yn(c,5,8,!1);if(Array.isArray(i))return i;throw new Error(i)}function la(c){let i;c==="bech32"?i=1:i=734539939;function t(k,j,P){if(P=P||90,k.length+7+j.length>P)throw new TypeError("Exceeds length limit");k=k.toLowerCase();let p=Hn(k);if(typeof p=="string")throw new Error(p);let V=k+"1";for(let G=0;G<j.length;++G){const R=j[G];if(R>>5!==0)throw new Error("Non 5-bit word");p=lr(p)^R,V+=Vr.charAt(R)}for(let G=0;G<6;++G)p=lr(p);p^=i;for(let G=0;G<6;++G){const R=p>>(5-G)*5&31;V+=Vr.charAt(R)}return V}function w(k,j){if(j=j||90,k.length<8)return k+" too short";if(k.length>j)return"Exceeds length limit";const P=k.toLowerCase(),p=k.toUpperCase();if(k!==P&&k!==p)return"Mixed-case string "+k;k=P;const V=k.lastIndexOf("1");if(V===-1)return"No separator character for "+k;if(V===0)return"Missing prefix for "+k;const G=k.slice(0,V),R=k.slice(V+1);if(R.length<6)return"Data too short";let m=Hn(G);if(typeof m=="string")return m;const $=[];for(let b=0;b<R.length;++b){const _t=R.charAt(b),W=wa[_t];if(W===void 0)return"Unknown character "+_t;m=lr(m)^W,!(b+6>=R.length)&&$.push(W)}return m!==i?"Invalid checksum for "+k:{prefix:G,words:$}}function u(k,j){const P=w(k,j);if(typeof P=="object")return P}function h(k,j){const P=w(k,j);if(typeof P=="object")return P;throw new Error(P)}return{decodeUnsafe:u,decode:h,encode:t,toWords:Us,fromWordsUnsafe:Ps,fromWords:Ms}}ur.bech32=la("bech32");ur.bech32m=la("bech32m");var Fs=zr&&zr.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(aa,"__esModule",{value:!0});const Ks=Fs(o_.exports),Pr=ur,Zr="asset";class xr{constructor(i){this.hashBuf=i}static fromHash(i){return new xr(i)}static fromParts(i,t){const w=(0,Ks.default)(20).update(new Uint8Array([...i,...t])).digest("binary");return xr.fromHash(w)}static fromBech32(i){const{prefix:t,words:w}=Pr.bech32.decode(i);if(t!==Zr)throw new Error("Invalid asset fingerprint");const u=Buffer.from(Pr.bech32.fromWords(w));return xr.fromHash(u)}fingerprint(){const i=Pr.bech32.toWords(this.hashBuf);return Pr.bech32.encode(Zr,i)}hash(){return Buffer.from(this.hashBuf).toString("hex")}prefix(){return Zr}checksum(){return this.fingerprint().slice(-6)}}var Hs=aa.default=xr;const qs=Hs,Rs=(c,i)=>{const t=zs(c),w=t.derive(Hr+1852).derive(Hr+1815).derive(Hr+i),u=w.derive(0).derive(0).to_raw_key(),h=w.derive(2).derive(0).to_raw_key();return w.free(),t.free(),{paymentKey:u,stakeKey:h}},ga=(c,i,t)=>{const w=new Map(i);w.set("lovelace",String(Number(w.get("lovelace"))+Number(t)));const u=new Map;for(let R=0;R<c.length;R++)u.set(R,c[R]);const h=new Set,k=new Set,j=new Set,P=new Set,p=new Set;for(let R=0;R<c.length;R++)switch(c[R].output.amount.length){case 1:{k.add(R);break}case 2:{j.add(R);break}case 3:{P.add(R);break}default:{p.add(R);break}}const V=(R,m,$)=>{const b=u.get(R);if(!b)return;const _t=Ls(b,m);if(Number(_t)>0){h.add(R),$.delete(R);for(const W of b.output.amount)w.set(W.unit,String(Number(w.get(W.unit))-Number(W.quantity)))}};for(const R of w.keys())if(R!="lovelace"){for(const m of j){const $=w.get(R);if(!$||Number($)<=0)break;V(m,R,j)}for(const m of P){const $=w.get(R);if(!$||Number($)<=0)break;V(m,R,P)}for(const m of p){const $=w.get(R);if(!$||Number($)<=0)break;V(m,R,p)}}for(const R of k){const m=w.get("lovelace");if(!m||Number(m)<=0)break;V(R,"lovelace",k)}for(const R of j){const m=w.get("lovelace");if(!m||Number(m)<=0)break;V(R,"lovelace",j)}for(const R of P){const m=w.get("lovelace");if(!m||Number(m)<=0)break;V(R,"lovelace",P)}for(const R of p){const m=w.get("lovelace");if(!m||Number(m)<=0)break;V(R,"lovelace",p)}for(const R of w.keys())if(Number(w.get(R))>0)return[];const G=[];for(const R of h){const m=u.get(R);m&&G.push(m)}return G},Ls=(c,i)=>{for(const t of c.output.amount)if(t.unit==i)return t.quantity;return"0"},cr=c=>y.exports.Address.from_bytes(kt(c)),zs=c=>y.exports.Bip32PrivateKey.from_bytes(kt(c)),Vs=c=>y.exports.DataHash.from_bytes(kt(c)),G_=c=>y.exports.Ed25519KeyHash.from_bytes(kt(c)),Gs=c=>y.exports.Ed25519Signature.from_bytes(kt(c)),vn=c=>y.exports.NativeScript.from_bytes(kt(c)),Ys=c=>y.exports.PublicKey.from_bytes(kt(c)),ua=c=>y.exports.PlutusData.from_bytes(kt(c)),br=(c,i)=>y.exports.PlutusScript.from_bytes_with_version(kt(c),V_[i]),$s=c=>y.exports.ScriptRef.from_bytes(kt(c)),Js=c=>y.exports.ScriptHash.from_bytes(kt(c)),Y_=c=>y.exports.Transaction.from_bytes(kt(c)),ba=c=>y.exports.TransactionHash.from_bytes(kt(c)),qn=c=>y.exports.TransactionUnspentOutput.from_bytes(kt(c)),Rn=c=>y.exports.TransactionWitnessSet.from_bytes(kt(c)),Ws=c=>y.exports.Value.from_bytes(kt(c)),O_=c=>y.exports.Address.from_bech32(c),mn=c=>y.exports.BaseAddress.from_address(O_(c)),fa=c=>y.exports.EnterpriseAddress.from_address(O_(c)),ha=c=>y.exports.RewardAddress.from_address(O_(c)),c_=c=>Buffer.from(c).toString("hex"),kt=c=>c.length%2===0&&/^[0-9A-F]*$/i.test(c)?Buffer.from(c,"hex"):Buffer.from(c,"utf-8"),kn=c=>{const i=t=>{const w=new Array;for(let u=0;u<t.len();u+=1)w.push(kn(t.get(u)));return w};switch(c.kind()){case y.exports.NativeScriptKind.ScriptAll:{const t=c.as_script_all();return{type:"all",scripts:i(t.native_scripts())}}case y.exports.NativeScriptKind.ScriptAny:{const t=c.as_script_any();return{type:"any",scripts:i(t.native_scripts())}}case y.exports.NativeScriptKind.ScriptNOfK:{const t=c.as_script_n_of_k();return{type:"atLeast",required:t.n(),scripts:i(t.native_scripts())}}case y.exports.NativeScriptKind.TimelockStart:return{type:"after",slot:c.as_timelock_start().slot_bignum().to_str()};case y.exports.NativeScriptKind.TimelockExpiry:return{type:"before",slot:c.as_timelock_expiry().slot_bignum().to_str()};case y.exports.NativeScriptKind.ScriptPubkey:return{type:"sig",keyHash:c.as_script_pubkey().addr_keyhash().to_hex()};default:throw new Error(`Script Kind: ${c.kind()}, is not supported`)}},Xr=c=>{const i=t=>{const w=y.exports.NativeScripts.new();return t.forEach(u=>{w.add(Xr(u))}),w};switch(c.type){case"all":return y.exports.NativeScript.new_script_all(y.exports.ScriptAll.new(i(c.scripts)));case"any":return y.exports.NativeScript.new_script_any(y.exports.ScriptAny.new(i(c.scripts)));case"atLeast":return y.exports.NativeScript.new_script_n_of_k(y.exports.ScriptNOfK.new(c.required,i(c.scripts)));case"after":return y.exports.NativeScript.new_timelock_start(y.exports.TimelockStart.new_timelockstart(y.exports.BigNum.from_str(c.slot)));case"before":return y.exports.NativeScript.new_timelock_expiry(y.exports.TimelockExpiry.new_timelockexpiry(y.exports.BigNum.from_str(c.slot)));case"sig":return y.exports.NativeScript.new_script_pubkey(y.exports.ScriptPubkey.new(G_(c.keyHash)))}},Rr=c=>{var w,u,h;const i=k=>{const j=[];for(let P=0;P<k.len();P+=1)j.push(Rr(k.get(P)));return j},t=k=>{const j=new Map;for(let P=0;P<k.len();P+=1){const p=k.keys().get(P),V=k.get(p)??y.exports.PlutusData.from_hex(p_("NO_ITEM_FOUND_INSIDE_GOLD_ROOM"));j.set(Rr(p),Rr(V))}return j};switch(c.kind()){case y.exports.PlutusDataKind.Bytes:return c_(c.as_bytes()??new Uint8Array);case y.exports.PlutusDataKind.Integer:return parseInt(((w=c.as_integer())==null?void 0:w.to_str())??"0",10);case y.exports.PlutusDataKind.List:return i(c.as_list()??y.exports.PlutusList.new());case y.exports.PlutusDataKind.Map:return t(c.as_map()??y.exports.PlutusMap.new());case y.exports.PlutusDataKind.ConstrPlutusData:return{alternative:parseInt(((u=c.as_constr_plutus_data())==null?void 0:u.alternative().to_str())??"0",10),fields:i(((h=c.as_constr_plutus_data())==null?void 0:h.data())??y.exports.PlutusList.new())};default:throw new Error(`PlutusData Kind: ${c.kind()}, is not supported`)}},Le=c=>{const i=t=>{const w=y.exports.PlutusList.new();return t.forEach(u=>{w.add(Le(u))}),w};switch(typeof c){case"string":return y.exports.PlutusData.new_bytes(kt(c));case"number":return y.exports.PlutusData.new_integer(y.exports.BigInt.from_str(c.toString()));case"bigint":return y.exports.PlutusData.new_integer(y.exports.BigInt.from_str(c.toString()));case"object":if(c instanceof Array){const t=i(c);return y.exports.PlutusData.new_list(t)}else if(c instanceof Map){const t=y.exports.PlutusMap.new();return c.forEach((w,u)=>{t.insert(Le(u),Le(w))}),y.exports.PlutusData.new_map(t)}else return y.exports.PlutusData.new_constr_plutus_data(y.exports.ConstrPlutusData.new(y.exports.BigNum.from_str(c.alternative.toString()),i(c.fields)))}},Xs=c=>{const i=y.exports.Relays.new();throw c.relays.forEach(t=>{i.add(ya(t))}),new Error("toPoolParams not implemented.")},sn=c=>{const i=t=>Xn[t];return y.exports.Redeemer.new(i(c.tag),y.exports.BigNum.from_str(c.index.toString()),Le(c.data),y.exports.ExUnits.new(y.exports.BigNum.from_str(c.budget.mem.toString()),y.exports.BigNum.from_str(c.budget.steps.toString())))},ya=c=>{switch(c.type){case"SingleHostAddr":{const i=c.IPV4?y.exports.Ipv4.new(new Uint8Array(c.IPV4.split(".").map(w=>parseInt(w)))):void 0,t=c.IPV6?y.exports.Ipv6.new(kt(c.IPV6.replaceAll(":",""))):void 0;return y.exports.Relay.new_single_host_addr(y.exports.SingleHostAddr.new(c.port,i,t))}case"SingleHostName":return y.exports.Relay.new_single_host_name(y.exports.SingleHostName.new(c.port,y.exports.DNSRecordAorAAAA.new(c.domainName)));case"MultiHostName":return y.exports.Relay.new_multi_host_name(y.exports.MultiHostName.new(y.exports.DNSRecordSRV.new(c.domainName)))}},va=c=>{if(c.is_plutus_script()){const t=c.plutus_script();return{code:t.to_hex(),version:Object.keys(V_).find(w=>V_[w].to_hex()===t.language_version().to_hex())}}const i=c.native_script();return kn(i)},fr=c=>{if("code"in c){const i=br(c.code,c.version);return y.exports.ScriptRef.new_plutus_script(i)}return y.exports.ScriptRef.new_native_script(Xr(c))},jr=c=>{var u,h,k;const i=c.output().has_data_hash()?(u=c.output().data_hash())==null?void 0:u.to_hex():void 0,t=c.output().has_plutus_data()?(h=c.output().plutus_data())==null?void 0:h.to_hex():void 0,w=c.output().has_script_ref()?(k=c.output().script_ref())==null?void 0:k.to_hex():void 0;return{input:{outputIndex:c.input().index(),txHash:c.input().transaction_id().to_hex()},output:{address:c.output().address().to_bech32(),amount:ma(c.output().amount()),dataHash:i,plutusData:t,scriptRef:w}}},Q_=c=>{const i=y.exports.TransactionInput.new(ba(c.input.txHash),c.input.outputIndex),t=y.exports.TransactionOutput.new(O_(c.output.address),Ee(c.output.amount));return c.output.dataHash!==void 0&&t.set_data_hash(Vs(c.output.dataHash)),c.output.plutusData!==void 0&&t.set_plutus_data(ua(c.output.plutusData)),c.output.scriptRef!==void 0&&t.set_script_ref($s(c.output.scriptRef)),y.exports.TransactionUnspentOutput.new(i,t)},Ln=c=>{const i=c.split(".")[1]??"0",t=`${parseInt(i,10)}`,w="1"+"0".repeat(i.length);return y.exports.UnitInterval.new(y.exports.BigNum.from_str(t),y.exports.BigNum.from_str(w))},p_=c=>c.length%2===0&&/^[0-9A-F]*$/i.test(c)?c:c_(Buffer.from(c,"utf-8")),xn=c=>Buffer.from(c,"hex").toString("utf-8"),ma=c=>{const i=[{unit:"lovelace",quantity:c.coin().to_str()}],t=c.multiasset();if(t!==void 0){const w=t.keys();for(let u=0;u<w.len();u+=1){const h=w.get(u),k=t.get(h);if(k!==void 0){const j=k.keys();for(let P=0;P<j.len();P+=1){const p=j.get(P),V=k.get(p)??y.exports.BigNum.from_str("0"),G=h.to_hex()+c_(p.name());i.push({unit:G,quantity:V.to_str()})}}}}return i},Ee=c=>{const i=c.find(h=>h.unit==="lovelace"),t=Array.from(new Set(c.filter(h=>h.unit!=="lovelace").map(h=>h.unit.slice(0,s_)))),w=y.exports.MultiAsset.new();t.forEach(h=>{const k=y.exports.Assets.new();c.filter(j=>j.unit.slice(0,s_)===h).forEach(j=>{k.insert(y.exports.AssetName.new(kt(j.unit.slice(s_))),y.exports.BigNum.from_str(j.quantity))}),w.insert(Js(h),k)});const u=y.exports.Value.new(y.exports.BigNum.from_str(i?i.quantity:"0"));return(c.length>1||!i)&&u.set_multiasset(w),u},zn=(c,i,t)=>y.exports.BaseAddress.new(c,y.exports.StakeCredential.from_keyhash(i),y.exports.StakeCredential.from_keyhash(t)),ka=(c,i="")=>y.exports.Bip32PrivateKey.from_bip39_entropy(kt(c),kt(p_(i))),on=c=>y.exports.DataCost.new_coins_per_byte(y.exports.BigNum.from_str(c)),Zs=c=>{if(typeof c!="object"||!("input"in c))return y.exports.DatumSource.new(Le(c));const i=Q_(c);if(i.output().has_plutus_data())return y.exports.DatumSource.new_ref_input(i.input());throw new Error(`No inline datum found in UTxO: ${i.input().transaction_id().to_hex()}`)},Vn=(c,i)=>y.exports.EnterpriseAddress.new(c,y.exports.StakeCredential.from_keyhash(i)),Gn=(c,i)=>{if(typeof c=="string")return y.exports.MintWitness.new_native_script(vn(c));if(i===void 0)throw new Error("Minting with plutus requires a redeemer to be defined");if(i.tag!=="MINT")throw new Error("Minting redeemer's tag must be defined as 'MINT'");return y.exports.MintWitness.new_plutus_script(cn(c),sn({tag:"MINT",index:0,budget:Ze,data:{alternative:0,fields:[]},...i}))},dn=(c,i)=>y.exports.RewardAddress.new(c,y.exports.StakeCredential.from_keyhash(i)),cn=c=>{if("code"in c)return y.exports.PlutusScriptSource.new(br(c.code,c.version));const i=Q_(c);if(i.output().has_script_ref()){const t=i.output().script_ref();if(t.is_plutus_script()){const w=va(t),u=br(w.code,w.version).hash();return y.exports.PlutusScriptSource.new_ref_input_with_lang_ver(u,i.input(),V_[w.version])}}throw new Error(`No plutus script reference found in UTxO: ${i.input().transaction_id().to_hex()}`)},Mr=c=>{const i=y.exports.ScriptPubkey.new(c);return y.exports.NativeScript.new_script_pubkey(i)},pn=(c=r_)=>{const i=y.exports.TransactionBuilderConfigBuilder.new().coins_per_utxo_byte(y.exports.BigNum.from_str(c.coinsPerUTxOSize)).ex_unit_prices(y.exports.ExUnitPrices.new(Ln(c.priceMem.toString()),Ln(c.priceStep.toString()))).fee_algo(y.exports.LinearFee.new(y.exports.BigNum.from_str(c.minFeeA.toString()),y.exports.BigNum.from_str(c.minFeeB.toString()))).key_deposit(y.exports.BigNum.from_str(c.keyDeposit)).max_tx_size(c.maxTxSize).max_value_size(parseInt(c.maxValSize,10)).pool_deposit(y.exports.BigNum.from_str(c.poolDeposit)).build();return y.exports.TransactionBuilder.new(i)},Yn=c=>{const i=y.exports.TxInputsBuilder.new();return c.map(t=>t instanceof y.exports.TransactionUnspentOutput?t:Q_(t)).forEach(t=>{i.add_input(t.output().address(),t.input(),t.output().amount())}),i},Fr=c=>{if(typeof c=="string")return y.exports.TransactionOutputBuilder.new().with_address(O_(c));let i=y.exports.TransactionOutputBuilder.new().with_address(O_(c.address));if(c.datum){const{value:t,inline:w}=c.datum,u=Le(t);i=i.with_data_hash(y.exports.hash_plutus_data(u)),w&&(i=i.with_plutus_data(u))}if(c.script){const t=fr(c.script);i=i.with_script_ref(t)}return i},Qe=c=>{const i=c.slice(0,s_),t=c.includes(".")?p_(c.split(".")[1]):c.slice(s_);return{policyId:i,assetName:t}},Y=c=>ze.default.isAxiosError(c)?c.response?JSON.stringify({data:c.response.data,headers:c.response.headers,status:c.response.status}):c.request?JSON.stringify(c.request):c.message:JSON.stringify(c),to=c=>{const i=Le(c);return y.exports.hash_plutus_data(i).to_hex()},_o=(c,i=Date.now())=>{if(Ar[c]){const[t,w,u,h]=Ar[c];return parseInt(y.exports.BigNum.from_str(i.toString()).div_floor(y.exports.BigNum.from_str("1000")).checked_sub(y.exports.BigNum.from_str(u)).div_floor(y.exports.BigNum.from_str(h)).checked_add(y.exports.BigNum.from_str(t)).to_str(),10)}throw new Error(`Couldn't resolve EpochNo for network: ${c}`)},An=(c,i)=>qs.fromParts(kt(c),kt(i)).fingerprint(),eo=(c,i)=>Zn[c][i],ro=c=>Xr(c).hash().to_hex(),tr=c=>{var i,t;try{const w=[(i=mn(c))==null?void 0:i.payment_cred().to_keyhash(),(t=fa(c))==null?void 0:t.payment_cred().to_keyhash()].find(u=>u!==void 0);if(w!==void 0)return w.to_hex();throw new Error(`Couldn't resolve payment key hash from address: ${c}`)}catch(w){throw new Error(`An error occurred during resolvePaymentKeyHash: ${w}.`)}},no=(c,i=0)=>{const t=br(c.code,c.version);return y.exports.EnterpriseAddress.new(i,y.exports.StakeCredential.from_scripthash(t.hash())).to_address().to_bech32()},ao=c=>{try{const i=fa(c),t=i==null?void 0:i.payment_cred().to_scripthash();if(t!==void 0)return t.to_hex();throw new Error(`Couldn't resolve script hash from address: ${c}`)}catch(i){throw new Error(`An error occurred during resolveScriptHash: ${i}.`)}},so=c=>y.exports.Ed25519KeyHash.from_hex(c).to_bech32("pool1"),xa=c=>{const i=tn.mnemonicToEntropy(c.join(" ")),t=ka(i),w=t.to_bech32();return t.free(),w},oo=c=>fr(c).to_hex(),io=(c,i=Date.now())=>{if(Ar[c]){const[t,w,u]=Ar[c];return y.exports.BigNum.from_str(i.toString()).div_floor(y.exports.BigNum.from_str("1000")).checked_sub(y.exports.BigNum.from_str(u)).checked_add(y.exports.BigNum.from_str(w)).to_str()}throw new Error(`Couldn't resolve SlotNo for network: ${c}`)},Br=c=>{try{const i=O_(c),t=mn(c),w=t==null?void 0:t.stake_cred().to_keyhash();if(w!==void 0)return dn(i.network_id(),w).to_address().to_bech32();throw new Error(`Couldn't resolve reward address from address: ${c}`)}catch(i){throw new Error(`An error occurred during resolveRewardAddress: ${i}.`)}},pr=c=>{var i,t;try{const w=[(i=mn(c))==null?void 0:i.stake_cred().to_keyhash(),(t=ha(c))==null?void 0:t.payment_cred().to_keyhash()].find(u=>u!==void 0);if(w!==void 0)return w.to_hex();throw new Error(`Couldn't resolve stake key hash from address: ${c}`)}catch(w){throw new Error(`An error occurred during resolveStakeKeyHash: ${w}.`)}},In=(c,i=r_.minFeeA,t=r_.minFeeB)=>(BigInt(i)*BigInt(c)+BigInt(t)).toString(),Aa=c=>{const i=Y_(c).body();return y.exports.hash_transaction(i).to_hex()},co=(c="",i=32)=>{if(i<=0||i>2048)throw new Error("Length must be bewteen 1 and 2048");const w=$n.customAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")(i);return p_(`${c}${w}`)},po=c=>Rr(ua(c));class wo{_axiosInstance;constructor(...i){if(typeof i[0]=="string"&&i[0].startsWith("http"))this._axiosInstance=ze.default.create({baseURL:i[0]});else{const t=i[0],w=t.slice(0,7);this._axiosInstance=ze.default.create({baseURL:`https://cardano-${w}.blockfrost.io/api/v${i[1]??0}`,headers:{project_id:t}})}}async fetchAccountInfo(i){const t=i.startsWith("addr")?Br(i):i;try{const{data:w,status:u}=await this._axiosInstance.get(`accounts/${t}`);if(u===200)return{poolId:w.pool_id,active:w.active||w.active_epoch!==null,balance:w.controlled_amount,rewards:w.withdrawable_amount,withdrawals:w.withdrawals_sum};throw Y(w)}catch(w){throw Y(w)}}resolveScriptRef=async i=>{if(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}`);if(w===200){const u=t.type.startsWith("plutus")?{code:await this.fetchPlutusScriptCBOR(i),version:t.type.replace("plutus","")}:await this.fetchNativeScriptJSON(i);return fr(u).to_hex()}throw Y(t)}};toUTxO=async(i,t)=>({input:{outputIndex:i.output_index,txHash:t},output:{address:i.address,amount:i.amount,dataHash:i.data_hash??void 0,plutusData:i.inline_datum??void 0,scriptRef:await this.resolveScriptRef(i.reference_script_hash),scriptHash:i.reference_script_hash}});async fetchAddressUTxOs(i,t){const w=t!==void 0?`/${t}`:"",u=`addresses/${i}/utxos`+w,h=async(k=1,j=[])=>{const{data:P,status:p}=await this._axiosInstance.get(`${u}?page=${k}`);if(p===200)return P.length>0?h(k+1,[...j,...await Promise.all(P.map(V=>this.toUTxO(V,V.tx_hash)))]):j;throw Y(P)};try{return await h()}catch{return[]}}async fetchAssetAddresses(i){const t=async(w=1,u=[])=>{const{policyId:h,assetName:k}=Qe(i),{data:j,status:P}=await this._axiosInstance.get(`assets/${h}${k}/addresses?page=${w}`);if(P===200)return j.length>0?t(w+1,[...u,...j]):u;throw Y(j)};try{return await t()}catch{return[]}}async fetchAssetMetadata(i){try{const{policyId:t,assetName:w}=Qe(i),{data:u,status:h}=await this._axiosInstance.get(`assets/${t}${w}`);if(h===200)return{...u.onchain_metadata};throw Y(u)}catch(t){throw Y(t)}}async fetchBlockInfo(i){try{const{data:t,status:w}=await this._axiosInstance.get(`blocks/${i}`);if(w===200)return{confirmations:t.confirmations,epoch:t.epoch,epochSlot:t.epoch_slot.toString(),fees:t.fees,hash:t.hash,nextBlock:t.next_block??"",operationalCertificate:t.op_cert,output:t.output??"0",previousBlock:t.previous_block,size:t.size,slot:t.slot.toString(),slotLeader:t.slot_leader??"",time:t.time,txCount:t.tx_count,VRFKey:t.block_vrf};throw Y(t)}catch(t){throw Y(t)}}async fetchCollectionAssets(i,t=1){try{const{data:w,status:u}=await this._axiosInstance.get(`assets/policy/${i}?page=${t}`);if(u===200)return{assets:w.map(h=>({unit:h.asset,quantity:h.quantity})),next:w.length===100?t+1:null};throw Y(w)}catch{return{assets:[],next:null}}}async fetchHandleAddress(i){try{const t=p_(i.replace("$","")),{data:w,status:u}=await this._axiosInstance.get(`assets/${Wr[1]}${t}/addresses`);if(u===200)return w[0].address;throw Y(w)}catch(t){throw Y(t)}}async fetchProtocolParameters(i=Number.NaN){try{const{data:t,status:w}=await this._axiosInstance.get(`epochs/${isNaN(i)?"latest":i}/parameters`);if(w===200)return{coinsPerUTxOSize:t.coins_per_utxo_word,collateralPercent:t.collateral_percent,decentralisation:t.decentralisation_param,epoch:t.epoch,keyDeposit:t.key_deposit,maxBlockExMem:t.max_block_ex_mem,maxBlockExSteps:t.max_block_ex_steps,maxBlockHeaderSize:t.max_block_header_size,maxBlockSize:t.max_block_size,maxCollateralInputs:t.max_collateral_inputs,maxTxExMem:t.max_tx_ex_mem,maxTxExSteps:t.max_tx_ex_steps,maxTxSize:t.max_tx_size,maxValSize:t.max_val_size,minFeeA:t.min_fee_a,minFeeB:t.min_fee_b,minPoolCost:t.min_pool_cost,poolDeposit:t.pool_deposit,priceMem:t.price_mem,priceStep:t.price_step};throw Y(t)}catch(t){throw Y(t)}}async fetchTxInfo(i){try{const{data:t,status:w}=await this._axiosInstance.get(`txs/${i}`);if(w===200)return{block:t.block,deposit:t.deposit,fees:t.fees,hash:t.hash,index:t.index,invalidAfter:t.invalid_hereafter??"",invalidBefore:t.invalid_before??"",slot:t.slot.toString(),size:t.size};throw Y(t)}catch(t){throw Y(t)}}async fetchUTxOs(i){try{const{data:t,status:w}=await this._axiosInstance.get(`txs/${i}/utxos`);if(w===200){const u=t.outputs,h=[];return u.forEach(j=>{h.push(this.toUTxO(j,i))}),await Promise.all(h)}throw Y(t)}catch(t){throw Y(t)}}onTxConfirmed(i,t,w=100){let u=0;const h=setInterval(()=>{u>=w&&clearInterval(h),this.fetchTxInfo(i).then(k=>{this.fetchBlockInfo(k.block).then(j=>{(j==null?void 0:j.confirmations)>0&&(clearInterval(h),t())}).catch(()=>{u+=1})}).catch(()=>{u+=1})},5e3)}async submitTx(i){try{const t={"Content-Type":"application/cbor"},{data:w,status:u}=await this._axiosInstance.post("tx/submit",kt(i),{headers:t});if(u===200)return w;throw Y(w)}catch(t){throw Y(t)}}async fetchPlutusScriptCBOR(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}/cbor`);if(w===200)return t.cbor;throw Y(t)}async fetchNativeScriptJSON(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}/json`);if(w===200)return t.json;throw Y(t)}}class lo{_axiosInstance;constructor(i,t,w){const u=w.host??"ipfs.infura.io",h=w.port??5001,k=w.version??0;this._axiosInstance=ze.default.create({baseURL:`https://${u}:${h}/api/v${k}`,auth:{username:i,password:t}})}async uploadContent(i,t=!1){try{const w={"Content-Type":"multipart/form-data"},{data:u,status:h}=await this._axiosInstance.post(`add?recursive=${t}`,i,{headers:w});if(h===200)return u;throw Y(u)}catch(w){throw Y(w)}}}class go{_axiosInstance;constructor(...i){if(typeof i[0]=="string"&&i[0].startsWith("http"))this._axiosInstance=ze.default.create({baseURL:i[0],headers:{Authorization:`Bearer ${i[1]}`}});else{let t=1;typeof i[2]=="number"&&(t=i[2]);const w={baseURL:`https://${i[0]}.koios.rest/api/v${t}`};typeof i[1]=="string"&&(w.headers={Authorization:`Bearer ${i[1]}`}),this._axiosInstance=ze.default.create(w)}}async fetchAccountInfo(i){try{const t=i.startsWith("addr")?Br(i):i,{data:w,status:u}=await this._axiosInstance.post("account_info",{_stake_addresses:[t]});if(u===200)return{poolId:w[0].delegated_pool,active:w[0].status==="registered",balance:w[0].total_balance.toString(),rewards:w[0].rewards_available,withdrawals:w[0].withdrawals};throw Y(w)}catch(t){throw Y(t)}}async fetchAddressUTxOs(i,t){try{const{data:w,status:u}=await this._axiosInstance.post("address_info",{_addresses:[i]});if(u===200){const h=w.flatMap(k=>k.utxo_set).map(k=>this.toUTxO(k,i));return t!==void 0?h.filter(k=>k.output.amount.find(j=>j.unit===t)!==void 0):h}throw Y(w)}catch{return[]}}async fetchAssetAddresses(i){try{const{policyId:t,assetName:w}=Qe(i),{data:u,status:h}=await this._axiosInstance.get(`asset_address_list?_asset_policy=${t}&_asset_name=${w}`);if(h===200)return u.map(k=>({address:k.payment_address,quantity:k.quantity}));throw Y(u)}catch(t){throw Y(t)}}async fetchAssetMetadata(i){try{const{policyId:t,assetName:w}=Qe(i),{data:u,status:h}=await this._axiosInstance.get(`asset_info?_asset_policy=${t}&_asset_name=${w}`);if(h===200)return{...u[0].minting_tx_metadata[721][t][xn(w)]};throw Y(u)}catch(t){throw Y(t)}}async fetchBlockInfo(i){try{const{data:t,status:w}=await this._axiosInstance.post("block_info",{_block_hashes:[i]});if(w===200)return{confirmations:t[0].num_confirmations,epoch:t[0].epoch_no,epochSlot:t[0].epoch_slot.toString(),fees:t[0].total_fees??"",hash:t[0].hash,nextBlock:t[0].child_hash??"",operationalCertificate:t[0].op_cert,output:t[0].total_output??"0",previousBlock:t[0].parent_hash,size:t[0].block_size,slot:t[0].abs_slot.toString(),slotLeader:t[0].pool??"",time:t[0].block_time,txCount:t[0].tx_count,VRFKey:t[0].vrf_key};throw Y(t)}catch(t){throw Y(t)}}async fetchCollectionAssets(i,t=0){try{const{data:w,status:u}=await this._axiosInstance.get(`asset_policy_info?_asset_policy=${i}&limit=100&offset=${t}`);if(u===200)return{assets:w.map(h=>({unit:`${i}${h.asset_name}`,quantity:h.total_supply})),next:w.length===100?t+100:null};throw Y(w)}catch(w){throw Y(w)}}async fetchHandleAddress(i){try{const t=p_(i.replace("$","")),{data:w,status:u}=await this._axiosInstance.get(`asset_address_list?_asset_policy=${Wr[1]}&_asset_name=${t}`);if(u===200)return w[0].payment_address;throw Y(w)}catch(t){throw Y(t)}}async fetchProtocolParameters(i){try{const{data:t,status:w}=await this._axiosInstance.get(`epoch_params?_epoch_no=${i}`);if(w===200)return{coinsPerUTxOSize:t[0].coins_per_utxo_size,collateralPercent:t[0].collateral_percent,decentralisation:t[0].decentralisation,epoch:t[0].epoch_no,keyDeposit:t[0].key_deposit,maxBlockExMem:t[0].max_block_ex_mem.toString(),maxBlockExSteps:t[0].max_block_ex_steps.toString(),maxBlockHeaderSize:t[0].max_bh_size,maxBlockSize:t[0].max_block_size,maxCollateralInputs:t[0].max_collateral_inputs,maxTxExMem:t[0].max_tx_ex_mem.toString(),maxTxExSteps:t[0].max_tx_ex_steps.toString(),maxTxSize:t[0].max_tx_size,maxValSize:t[0].max_val_size.toString(),minFeeA:t[0].min_fee_a,minFeeB:t[0].min_fee_b,minPoolCost:t[0].min_pool_cost,poolDeposit:t[0].pool_deposit,priceMem:t[0].price_mem,priceStep:t[0].price_step};throw Y(t)}catch(t){throw Y(t)}}async fetchTxInfo(i){var t,w;try{const{data:u,status:h}=await this._axiosInstance.post("tx_info",{_tx_hashes:[i]});if(h===200)return{block:u[0].block_hash,deposit:u[0].deposit,fees:u[0].fee,hash:u[0].tx_hash,index:u[0].tx_block_index,invalidAfter:((t=u[0].invalid_after)==null?void 0:t.toString())??"",invalidBefore:((w=u[0].invalid_before)==null?void 0:w.toString())??"",slot:u[0].absolute_slot.toString(),size:u[0].tx_size};throw Y(u)}catch(u){throw Y(u)}}async fetchUTxOs(i){try{const{data:t,status:w}=await this._axiosInstance.post("tx_info",{_tx_hashes:[i]});if(w===200)return t[0].outputs.map(h=>this.toUTxO(h,h.payment_addr.bech32));throw Y(t)}catch(t){throw Y(t)}}onTxConfirmed(i,t,w=100){let u=0;const h=setInterval(()=>{u>=w&&clearInterval(h),this.fetchTxInfo(i).then(k=>{this.fetchBlockInfo(k.block).then(j=>{(j==null?void 0:j.confirmations)>0&&(clearInterval(h),t())}).catch(()=>{u+=1})}).catch(()=>{u+=1})},5e3)}async submitTx(i){try{const t={"Content-Type":"application/cbor"},{data:w,status:u}=await this._axiosInstance.post("submittx",kt(i),{headers:t});if(u===202)return w;throw Y(w)}catch(t){throw Y(t)}}toUTxO(i,t){var w,u;return{input:{outputIndex:i.tx_index,txHash:i.tx_hash},output:{address:t,amount:[{unit:"lovelace",quantity:i.value},...i.asset_list.map(h=>({unit:`${h.policy_id}${h.asset_name}`,quantity:`${h.quantity}`}))],dataHash:i.datum_hash??void 0,plutusData:((w=i.inline_datum)==null?void 0:w.bytes)??void 0,scriptRef:this.resolveScriptRef(i.reference_script),scriptHash:((u=i.reference_script)==null?void 0:u.hash)??void 0}}}resolveScriptRef=i=>{if(i){const t=i.type.startsWith("plutus")?{code:i.bytes,version:i.type.replace("plutus","")}:kn(vn(i.bytes));return fr(t).to_hex()}}}const uo=c=>{const i=[];return c.forEach(t=>{const w=i.find(u=>u.unit===t.unit);w?w.quantity=(parseInt(w.quantity)+parseInt(t.quantity)).toString():i.push(t)}),i},bo=["testnet","preview","preprod","mainnet"],Ia=c=>bo.includes(c);class fo{_baseUrl;constructor(...i){this._baseUrl=Ia(i[0])?ta[i[0]]:i[0]}async evaluateTx(i){const t=await this.open();return this.send(t,"EvaluateTx",{evaluate:i}),new Promise((w,u)=>{t.addEventListener("message",h=>{try{const{result:k}=JSON.parse(h.data);k.EvaluationResult?w(Object.keys(k.EvaluationResult).map(j=>({index:parseInt(j.split(":")[1],10),tag:j.split(":")[0].toUpperCase(),budget:{mem:k.EvaluationResult[j].memory,steps:k.EvaluationResult[j].steps}}))):u(k.EvaluationFailure),t.close()}catch(k){u(k)}},{once:!0})})}async onNextTx(i){const t=await this.open();return this.send(t,"AwaitAcquire",{}),t.addEventListener("message",w=>{const{result:u}=JSON.parse(w.data);if(u===null)return this.send(t,"AwaitAcquire",{});u.AwaitAcquired===void 0&&i(u),this.send(t,"NextTx",{})}),()=>t.close()}async submitTx(i){const t=await this.open();return this.send(t,"SubmitTx",{submit:i}),new Promise((w,u)=>{t.addEventListener("message",h=>{try{const{result:k}=JSON.parse(h.data);k.SubmitSuccess?w(k.SubmitSuccess.txId):u(k.SubmitFail),t.close()}catch(k){u(k)}},{once:!0})})}async open(){const i=new WebSocket(this._baseUrl);return await new Promise(t=>{i.addEventListener("open",()=>t(!0),{once:!0})}),i}send(i,t,w){i.send(JSON.stringify({version:"1.0",type:"jsonwsp/request",servicename:"ogmios",methodname:t,args:w}))}}class ho{_axiosInstance;_amountsAsStrings={headers:{"amounts-as-strings":"true"}};submitUrl;constructor({network:i,apiKey:t,turboSubmit:w=!1}){this._axiosInstance=ze.default.create({baseURL:`https://${i}.gomaestro-api.org/v1`,headers:{"api-key":t}}),this.submitUrl=w?"txmanager/turbosubmit":"txmanager"}async evaluateTx(i){try{const{data:t,status:w}=await this._axiosInstance.post("transactions/evaluate",{cbor:i});if(w===200){const u={spend:"SPEND",mint:"MINT",cert:"CERT",wdrl:"REWARD"};return t.map(k=>{const j=k.ex_units,P=k.redeemer_index,p=u[k.redeemer_tag];return{budget:j,index:P,tag:p}})}throw Y(t)}catch(t){throw Y(t)}}async fetchAccountInfo(i){const t=i.startsWith("addr")?Br(i):i;try{const{data:w,status:u}=await this._axiosInstance.get(`accounts/${t}`,this._amountsAsStrings);if(u===200){const h=w.data;return{poolId:h.delegated_pool,active:h.registered,balance:h.total_balance,rewards:h.rewards_available,withdrawals:h.total_withdrawn}}throw Y(w)}catch(w){throw Y(w)}}async fetchAddressUTxOs(i,t){const w=(()=>i.startsWith("addr_vkh")||i.startsWith("addr_shared_vkh")?`addresses/cred/${i}`:`addresses/${i}`)(),u=t?`&asset=${t}`:"",h=async(k=null,j=[])=>{const P=k===null?"":`&cursor=${k}`,{data:p,status:V}=await this._axiosInstance.get(`${w}/utxos?count=100${u}${P}`,this._amountsAsStrings);if(V===200){const R=p.data.map(this.toUTxO),m=[...j,...R],$=p.next_cursor;return $==null?m:h($,m)}throw Y(p)};try{return await h()}catch{return[]}}async fetchAssetAddresses(i){const{policyId:t,assetName:w}=Qe(i),u=async(h=null,k=[])=>{const j=h===null?"":`&cursor=${h}`,{data:P,status:p}=await this._axiosInstance.get(`assets/${t}${w}/addresses?count=100${j}`,this._amountsAsStrings);if(p===200){const G=P.data.map($=>({address:$.address,quantity:$.amount})),R=P.next_cursor,m=[...k,...G];return R==null?m:u(R,m)}throw Y(P)};try{return await u()}catch{return[]}}async fetchAssetMetadata(i){try{const{policyId:t,assetName:w}=Qe(i),{data:u,status:h}=await this._axiosInstance.get(`assets/${t}${w}`);if(h===200){const k=u.data;return{...k.asset_standards.cip25_metadata,...k.asset_standards.cip68_metadata}}throw Y(u)}catch(t){throw Y(t)}}async fetchBlockInfo(i){var t;try{const{data:w,status:u}=await this._axiosInstance.get(`blocks/${i}`,this._amountsAsStrings);if(u===200){const h=w.data;return{confirmations:h.confirmations,epoch:h.epoch,epochSlot:h.epoch_slot.toString(),fees:h.total_fees,hash:h.hash,nextBlock:h.next_block??"",operationalCertificate:(t=h.operational_certificate)==null?void 0:t.hot_vkey,output:h.total_output_lovelace??"0",previousBlock:h.previous_block,size:h.size,slot:h.absolute_slot.toString(),slotLeader:h.block_producer??"",time:Date.parse(h.timestamp)/1e3,txCount:h.tx_hashes.length,VRFKey:y.exports.VRFVKey.from_hex(h.vrf_key).to_bech32("vrf_vk")}}throw Y(w)}catch(w){throw Y(w)}}async fetchCollectionAssets(i,t){try{const{data:w,status:u}=await this._axiosInstance.get(`policy/${i}/assets?count=100${t?`&cursor=${t}`:""}`);if(u===200)return{assets:w.data.map(k=>({unit:i+k.asset_name,quantity:k.total_supply})),next:w.next_cursor};throw Y(w)}catch{return{assets:[],next:null}}}async fetchHandleAddress(i){try{const t=i.charAt(0)==="$"?i.substring(1):i,{data:w,status:u}=await this._axiosInstance.get(`ecosystem/adahandle/${t}`);if(u===200)return w.data;throw Y(w)}catch(t){throw Y(t)}}async fetchProtocolParameters(i=Number.NaN){if(!isNaN(i))throw new Error("Maestro only supports fetching Protocol parameters of the latest completed epoch.");const t=w=>{const u=w.indexOf("/");return parseInt(w.slice(0,u))/parseInt(w.slice(u+1))};try{const{data:w,status:u}=await this._axiosInstance.get("protocol-params");if(u===200){const h=w.data;try{const{data:k,status:j}=await this._axiosInstance.get("epochs/current");if(j===200){const P=k.data;return{coinsPerUTxOSize:h.coins_per_utxo_byte.toString(),collateralPercent:parseInt(h.collateral_percentage),decentralisation:0,epoch:parseInt(P.epoch_no),keyDeposit:h.stake_key_deposit.toString(),maxBlockExMem:h.max_execution_units_per_block.memory.toString(),maxBlockExSteps:h.max_execution_units_per_block.steps.toString(),maxBlockHeaderSize:parseInt(h.max_block_header_size),maxBlockSize:parseInt(h.max_block_body_size),maxCollateralInputs:parseInt(h.max_collateral_inputs),maxTxExMem:h.max_execution_units_per_transaction.memory.toString(),maxTxExSteps:h.max_execution_units_per_transaction.steps.toString(),maxTxSize:parseInt(h.max_tx_size),maxValSize:h.max_value_size.toString(),minFeeA:h.min_fee_coefficient,minFeeB:h.min_fee_constant,minPoolCost:h.min_pool_cost.toString(),poolDeposit:h.pool_deposit.toString(),priceMem:t(h.prices.memory),priceStep:t(h.prices.steps)}}throw Y(k)}catch(k){throw Y(k)}}throw Y(w)}catch(w){throw Y(w)}}async fetchTxInfo(i){try{const{data:t,status:w}=await this._axiosInstance.get(`transactions/${i}`);if(w===200){const u=t.data;return{block:u.block_hash,deposit:u.deposit.toString(),fees:u.fee.toString(),hash:u.tx_hash,index:u.block_tx_index,invalidAfter:u.invalid_hereafter??"",invalidBefore:u.invalid_before??"",slot:u.block_absolute_slot.toString(),size:u.size-1}}throw Y(t)}catch(t){throw Y(t)}}async fetchUTxOs(i){try{const{data:t,status:w}=await this._axiosInstance.get(`transactions/${i}`,this._amountsAsStrings);if(w===200)return t.data.outputs.map(this.toUTxO);throw Y(t)}catch(t){throw Y(t)}}onTxConfirmed(i,t,w=100){let u=0;const h=setInterval(()=>{u>=w&&clearInterval(h),this.fetchTxInfo(i).then(k=>{this.fetchBlockInfo(k.block).then(j=>{(j==null?void 0:j.confirmations)>0&&(clearInterval(h),t())}).catch(()=>{u+=1})}).catch(()=>{u+=1})},5e3)}async submitTx(i){try{const t={"Content-Type":"application/cbor"},{data:w,status:u}=await this._axiosInstance.post(this.submitUrl,kt(i),{headers:t});if(u===202)return w;throw Y(w)}catch(t){throw Y(t)}}toUTxO=i=>{var t,w,u;return{input:{outputIndex:i.index,txHash:i.tx_hash},output:{address:i.address,amount:i.assets.map(h=>({unit:h.unit,quantity:h.amount})),dataHash:(t=i.datum)==null?void 0:t.hash,plutusData:(w=i.datum)==null?void 0:w.bytes,scriptRef:this.resolveScript(i),scriptHash:(u=i.reference_script)==null?void 0:u.hash}}};resolveScript=i=>{if(i.reference_script){const t=i.reference_script.type==="native"?i.reference_script.json:{code:i.reference_script.bytes,version:i.reference_script.type.replace("plutusv","V")};return fr(t).to_hex()}else return}}class yo{_axiosInstance;constructor(i="http://localhost:8080/api/v1"){this._axiosInstance=ze.default.create({baseURL:i})}async fetchAccountInfo(i){const t=i.startsWith("addr")?Br(i):i;try{const{data:w,status:u}=await this._axiosInstance.get(`accounts/${t}`);if(u===200)return{poolId:w.pool_id,active:w.active||w.active_epoch!==null,balance:w.controlled_amount,rewards:w.withdrawable_amount,withdrawals:w.withdrawals_sum};throw Y(w)}catch(w){throw Y(w)}}resolveScriptRef=async i=>{if(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}`);if(w===200){const u=t.type.startsWith("plutus")?{code:await this.fetchPlutusScriptCBOR(i),version:t.type.replace("plutus","")}:await this.fetchNativeScriptJSON(i);return fr(u).to_hex()}throw Y(t)}};toUTxO=async(i,t)=>({input:{outputIndex:i.output_index,txHash:t},output:{address:i.address,amount:i.amount.map(w=>({...w,quantity:w.quantity.toString()})),dataHash:i.data_hash??void 0,plutusData:i.inline_datum??void 0,scriptRef:await this.resolveScriptRef(i.reference_script_hash),scriptHash:i.reference_script_hash}});async fetchAddressUTxOs(i,t){const w=t!==void 0?`/${t}`:"",u=`addresses/${i}/utxos`+w,h=async(k=1,j=[])=>{const{data:P,status:p}=await this._axiosInstance.get(`${u}?page=${k}`);if(p===200)return P.length>0?h(k+1,[...j,...await Promise.all(P.map(V=>this.toUTxO(V,V.tx_hash)))]):j;throw Y(P)};try{return await h()}catch{return[]}}async fetchAssetAddresses(i){const t=async(w=1,u=[])=>{const{policyId:h,assetName:k}=Qe(i),{data:j,status:P}=await this._axiosInstance.get(`assets/${h}${k}/addresses?page=${w}`);if(P===200)return j.length>0?t(w+1,[...u,...j]):u;throw Y(j)};try{return await t()}catch{return[]}}async fetchAssetMetadata(i){try{const{policyId:t,assetName:w}=Qe(i),{data:u,status:h}=await this._axiosInstance.get(`assets/${t}${w}`);if(h===200)return{...u.onchain_metadata};throw Y(u)}catch(t){throw Y(t)}}async fetchBlockInfo(i){try{const{data:t,status:w}=await this._axiosInstance.get(`blocks/${i}`);if(w===200)return{confirmations:t.confirmations,epoch:t.epoch,epochSlot:t.epoch_slot.toString(),fees:t.fees,hash:t.hash,nextBlock:t.next_block??"",operationalCertificate:t.op_cert,output:t.output??"0",previousBlock:t.previous_block,size:t.size,slot:t.slot.toString(),slotLeader:t.slot_leader??"",time:t.time,txCount:t.tx_count,VRFKey:t.block_vrf};throw Y(t)}catch(t){throw Y(t)}}async fetchCollectionAssets(i,t=1){try{const{data:w,status:u}=await this._axiosInstance.get(`assets/policy/${i}?page=${t}`);if(u===200)return{assets:w.map(h=>({unit:h.asset,quantity:h.quantity})),next:w.length===100?t+1:null};throw Y(w)}catch{return{assets:[],next:null}}}async fetchHandleAddress(i){try{const t=p_(i.replace("$","")),{data:w,status:u}=await this._axiosInstance.get(`assets/${Wr[1]}${t}/addresses`);if(u===200)return w[0].address;throw Y(w)}catch(t){throw Y(t)}}async fetchProtocolParameters(i=Number.NaN){try{const{data:t,status:w}=await this._axiosInstance.get(`epochs/${isNaN(i)?"latest":i}/parameters`);if(w===200)return{coinsPerUTxOSize:t.coins_per_utxo_word,collateralPercent:t.collateral_percent,decentralisation:t.decentralisation_param,epoch:t.epoch,keyDeposit:t.key_deposit,maxBlockExMem:t.max_block_ex_mem,maxBlockExSteps:t.max_block_ex_steps,maxBlockHeaderSize:t.max_block_header_size,maxBlockSize:t.max_block_size,maxCollateralInputs:t.max_collateral_inputs,maxTxExMem:t.max_tx_ex_mem,maxTxExSteps:t.max_tx_ex_steps,maxTxSize:t.max_tx_size,maxValSize:t.max_val_size,minFeeA:t.min_fee_a,minFeeB:t.min_fee_b,minPoolCost:t.min_pool_cost,poolDeposit:t.pool_deposit,priceMem:t.price_mem,priceStep:t.price_step};throw Y(t)}catch(t){throw Y(t)}}async fetchTxInfo(i){try{const{data:t,status:w}=await this._axiosInstance.get(`txs/${i}`);if(w===200)return{block:t.block,deposit:t.deposit,fees:t.fees,hash:t.hash,index:t.index,invalidAfter:t.invalid_hereafter??"",invalidBefore:t.invalid_before??"",slot:t.slot.toString(),size:t.size};throw Y(t)}catch(t){throw Y(t)}}async fetchUTxOs(i){try{const{data:t,status:w}=await this._axiosInstance.get(`txs/${i}/utxos`);if(w===200){const u=t.outputs,h=[];return u.forEach(j=>{h.push(this.toUTxO(j,i))}),await Promise.all(h)}throw Y(t)}catch(t){throw Y(t)}}onTxConfirmed(i,t,w=100){let u=0;const h=setInterval(()=>{u>=w&&clearInterval(h),this.fetchTxInfo(i).then(k=>{this.fetchBlockInfo(k.block).then(j=>{(j==null?void 0:j.confirmations)>0&&(clearInterval(h),t())}).catch(()=>{u+=1})}).catch(()=>{u+=1})},5e3)}async submitTx(i){try{const t={"Content-Type":"text/plain"},{status:w,data:u}=await this._axiosInstance.post("/tx/submit",i,{headers:t});if(w===202)return u;throw Y(u)}catch(t){throw console.log("error",t),Y(t)}}async fetchPlutusScriptCBOR(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}/cbor`);if(w===200)return t.cbor;throw Y(t)}async fetchNativeScriptJSON(i){const{data:t,status:w}=await this._axiosInstance.get(`scripts/${i}/json`);if(w===200)return t.json;throw Y(t)}}class vo{static withOneSignature(i){const t=G_(tr(i));return Mr(t).to_hex()}static withAtLeastNSignatures(i,t){const w=y.exports.NativeScripts.new();i.forEach(h=>{const k=G_(tr(h));w.add(Mr(k))});const u=y.exports.ScriptNOfK.new(t,w);return y.exports.NativeScript.new_script_any(u).to_hex()}static withAnySignature(i){const t=y.exports.NativeScripts.new();i.forEach(u=>{const h=G_(tr(u));t.add(Mr(h))});const w=y.exports.ScriptAny.new(t);return y.exports.NativeScript.new_script_any(w).to_hex()}static withAllSignatures(i){const t=y.exports.NativeScripts.new();i.forEach(u=>{const h=G_(tr(u));t.add(Mr(h))});const w=y.exports.ScriptAll.new(t);return y.exports.NativeScript.new_script_any(w).to_hex()}static fromNativeScript(i){return Xr(i).to_hex()}}function Ve(c,i,t,w){var u=arguments.length,h=u<3?i:w===null?w=Object.getOwnPropertyDescriptor(i,t):w,k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(c,i,t,w);else for(var j=c.length-1;j>=0;j--)(k=c[j])&&(h=(u<3?k(h):u>3?k(i,t,h):k(i,t))||h);return u>3&&h&&Object.defineProperty(i,t,h),h}const mo=c=>class extends c{__visits=[]},er=()=>function(c,i,t){const w=t.value;t.value=function(...u){const h=w.call(this,...u);return this.__visits&&this.__visits.push(i),h}};exports.Transaction=class{_changeAddress;_txOutputs=new Map;_recipients=new Map;_totalBurns=new Map;_totalMints=new Map;_era;_initiator;_mintBuilder;_protocolParameters;_txBuilder;_txCertificates;_txInputsBuilder;_txWithdrawals;constructor(i={}){this._era=i.era,this._initiator=i.initiator,this._mintBuilder=y.exports.MintBuilder.new(),this._protocolParameters=i.parameters??r_,this._txBuilder=pn(i.parameters),this._txCertificates=y.exports.Certificates.new(),this._txInputsBuilder=y.exports.TxInputsBuilder.new(),this._txWithdrawals=y.exports.Withdrawals.new()}static attachMetadata(i,t,w="BABBAGE"){var k;const u=Y_(i),h=u.auxiliary_data()??y.exports.AuxiliaryData.new();if(h.set_metadata(y.exports.GeneralTransactionMetadata.from_hex(t)),h.set_prefer_alonzo_format(w==="ALONZO"),y.exports.hash_auxiliary_data(h).to_hex()!==((k=u.body().auxiliary_data_hash())==null?void 0:k.to_hex()))throw new Error("[Transaction] attachMetadata: The metadata hash does not match the auxiliary data hash.");return y.exports.Transaction.new(u.body(),u.witness_set(),h).to_hex()}static deattachMetadata(i){const t=Y_(i);return y.exports.Transaction.new(t.body(),t.witness_set(),void 0).to_hex()}static maskMetadata(i,t="BABBAGE"){var h;const w=Y_(i),u=(h=w.auxiliary_data())==null?void 0:h.metadata();if(u!==void 0){const k=y.exports.GeneralTransactionMetadata.new();for(let P=0;P<u.len();P+=1){const p=u.keys().get(P),V=u.get(p);k.insert(p,y.exports.TransactionMetadatum.from_hex("0".repeat(((V==null?void 0:V.to_hex())??"").length)))}const j=w.auxiliary_data();return j!==void 0&&(j.set_metadata(k),j.set_prefer_alonzo_format(t==="ALONZO")),y.exports.Transaction.new(w.body(),w.witness_set(),j).to_hex()}return i}static readMetadata(i){var w,u;return((u=(w=Y_(i).auxiliary_data())==null?void 0:w.metadata())==null?void 0:u.to_hex())??""}static writeMetadata(i,t,w="BABBAGE"){const u=Y_(i),h=u.auxiliary_data()??y.exports.AuxiliaryData.new();return h.set_metadata(y.exports.GeneralTransactionMetadata.from_hex(t)),h.set_prefer_alonzo_format(w==="ALONZO"),y.exports.Transaction.new(u.body(),u.witness_set(),h).to_hex()}get size(){return this._txBuilder.full_size()}async build(){try{return(this._mintBuilder.has_plutus_scripts()||this.notVisited("redeemValue")===!1)&&(await this.addRequiredSignersIfNeeded(),await this.addCollateralIfNeeded()),await this.forgeAssetsIfNeeded(),await this.addTxInputsAsNeeded(),await this.addChangeAddress(),this._txBuilder.build_tx().to_hex()}catch(i){throw new Error(`[Transaction] An error occurred during build: ${i}.`)}}burnAsset(i,t,w){const u=this._totalBurns.has(t.unit)?y.exports.BigNum.from_str(this._totalBurns.get(t.unit)??"0").checked_add(y.exports.BigNum.from_str(t.quantity)).to_str():t.quantity;return this._mintBuilder.add_asset(Gn(i,w),y.exports.AssetName.new(kt(t.unit.slice(s_))),y.exports.Int.new_negative(y.exports.BigNum.from_str(t.quantity))),this._totalBurns.set(t.unit,u),this}delegateStake(i,t){const w=y.exports.Certificate.new_stake_delegation(y.exports.StakeDelegation.new(y.exports.StakeCredential.from_keyhash(G_(pr(i))),y.exports.Ed25519KeyHash.from_bech32(t)));return this._txCertificates.add(w),this}deregisterStake(i){const t=y.exports.Certificate.new_stake_deregistration(y.exports.StakeDeregistration.new(y.exports.StakeCredential.from_keyhash(G_(pr(i)))));return this._txCertificates.add(t),this}mintAsset(i,t,w){var p,V;const u=(G,R)=>{const m=typeof G=="string"?vn(G).hash().to_hex():h(G).hash().to_hex(),$=p_(R.assetName);return{unit:`${m}${$}`,quantity:R.assetQuantity}},h=G=>{if("code"in G)return br(G.code,G.version);const R=Q_(G);if(R.output().has_script_ref()){const m=R.output().script_ref();if(m.is_plutus_script()){const $=va(m);return br($.code,$.version)}}throw new Error(`[Transaction] No plutus script reference found in UTxO: ${R.input().transaction_id().to_hex()}`)},k=u(i,t),P=y.exports.BigNum.from_str(((p=this._totalMints.get(k.unit))==null?void 0:p.assetQuantity)??"0").checked_add(y.exports.BigNum.from_str(k.quantity));return this._mintBuilder.add_asset(Gn(i,w),y.exports.AssetName.new(kt(p_(t.assetName))),y.exports.Int.new(y.exports.BigNum.from_str(k.quantity))),this._recipients.has(t.recipient)?(V=this._recipients.get(t.recipient))==null||V.push(k):this._recipients.set(t.recipient,[k]),this._totalMints.set(k.unit,{...t,assetQuantity:P.to_str()}),this}redeemValue(i){const t={tag:"SPEND",budget:Ze,index:this._txInputsBuilder.inputs().len(),data:{alternative:0,fields:[]},...i.redeemer},w=Q_(i.value),u=i.datum?y.exports.PlutusWitness.new_with_ref(cn(i.script),Zs(i.datum),sn(t)):y.exports.PlutusWitness.new_with_ref_without_datum(cn(i.script),sn(t));return this._txInputsBuilder.add_plutus_script_input(u,w.input(),w.output().amount()),this}registerStake(i){const t=y.exports.Certificate.new_stake_registration(y.exports.StakeRegistration.new(y.exports.StakeCredential.from_keyhash(G_(pr(i)))));return this._txCertificates.add(t),this}registerPool(i){const t=y.exports.Certificate.new_pool_registration(y.exports.PoolRegistration.new(Xs(i)));return this._txCertificates.add(t),this}retirePool(i,t){const w=y.exports.Certificate.new_pool_retirement(y.exports.PoolRetirement.new(y.exports.Ed25519KeyHash.from_bech32(i),t));return this._txCertificates.add(w),this}sendAssets(i,t){const w=Ee(t),u=w.multiasset();if(w.is_zero()||u===void 0)return this;const h=Fr(i).next(),k=w.coin().is_zero()?h.with_asset_and_min_required_coin_by_utxo_cost(u,on(this._protocolParameters.coinsPerUTxOSize)).build():h.with_coin_and_asset(w.coin(),u).build();return t.forEach(j=>{this.setTxOutput(j)}),this._txBuilder.add_output(k),this}sendLovelace(i,t){const u=Fr(i).next().with_coin(y.exports.BigNum.from_str(t)).build();return this.setTxOutput({unit:"lovelace",quantity:t}),this._txBuilder.add_output(u),this}sendToken(i,t,w){return this.sendAssets(i,[{quantity:w,unit:_a[t]}]),this}sendValue(i,t){const w=Ee(t.output.amount),h=Fr(i).next().with_value(w).build();return t.output.amount.forEach(k=>{this.setTxOutput(k)}),this._txBuilder.add_output(h),this}setChangeAddress(i){return this._changeAddress=O_(i),this}setCollateral(i){const t=Yn(i);return this._txBuilder.set_collateral(t),this}setMetadata(i,t){return this._txBuilder.add_json_metadatum_with_schema(y.exports.BigNum.from_str(i.toString()),JSON.stringify(t),y.exports.MetadataJsonSchema.NoConversions),this}setRequiredSigners(i){return Array.from(new Set(i.map(w=>w.startsWith("addr")?tr(w):pr(w)).map(w=>G_(w)))).forEach(w=>{this._txBuilder.add_required_signer(w)}),this}setTimeToStart(i){return this._txBuilder.set_validity_start_interval_bignum(y.exports.BigNum.from_str(i)),this}setTimeToExpire(i){return this._txBuilder.set_ttl_bignum(y.exports.BigNum.from_str(i)),this}setTxInputs(i){return i.map(t=>Q_(t)).forEach(t=>{this._txInputsBuilder.add_input(t.output().address(),t.input(),t.output().amount())}),this}setTxRefInputs(i){return i.map(t=>Q_(t)).forEach(t=>{this._txBuilder.add_reference_input(t.input())}),this}withdrawRewards(i,t){const w=ha(i);return w!==void 0&&this._txWithdrawals.insert(w,y.exports.BigNum.from_str(t)),this}async addBurnInputsIfNeeded(){if(this._initiator&&this._totalBurns.size>0&&this.notVisited("setTxInputs")){const i=await this._initiator.getUsedUTxOs();ra(this._totalBurns,i.map(w=>jr(w))).map(w=>Q_(w)).forEach(w=>{this._txInputsBuilder.add_input(w.output().address(),w.input(),w.output().amount())})}}async addChangeAddress(){if(this._initiator&&this._changeAddress===void 0){const i=await this._initiator.getUsedAddress();this._txBuilder.add_change_if_needed(i)}else this._changeAddress!==void 0&&this._txBuilder.add_change_if_needed(this._changeAddress)}async addCollateralIfNeeded(){if(this._initiator&&this.notVisited("setCollateral")){const i=await this._initiator.getUsedCollateral();this._txBuilder.set_collateral(Yn(i))}}async addRequiredSignersIfNeeded(){if(this._initiator&&this.notVisited("setRequiredSigners")){const i=await this._initiator.getUsedAddress(),t=tr(i.to_bech32());this._txBuilder.add_required_signer(G_(t))}}async addTxInputsAsNeeded(){if(this.notVisited("setTxInputs")){const i=await this.filterAvailableUTxOs();ea(this._txOutputs,i.map(w=>jr(w))).map(w=>Q_(w)).forEach(w=>{this._txInputsBuilder.add_input(w.output().address(),w.input(),w.output().amount())})}if(this._txBuilder.set_inputs(this._txInputsBuilder),(this._mintBuilder.has_native_scripts()||this._mintBuilder.has_plutus_scripts())&&this._txBuilder.set_mint_builder(this._mintBuilder),this._txCertificates.len()>0&&this._txBuilder.set_certs(this._txCertificates),this._txWithdrawals.len()>0&&this._txBuilder.set_withdrawals(this._txWithdrawals),this._txBuilder.get_mint_builder()||this.notVisited("redeemValue")===!1){const i=this._era!==void 0?nn[this._era]:nn.BABBAGE;this._txBuilder.calc_script_data_hash(i)}}async forgeAssetsIfNeeded(){const i=(t,w)=>{const u=t.data.assetName,h=t.data.metadata,k=t.unit.slice(0,s_);if(t.data.label==="777")return h;if(w&&w[k]){const{[k]:j,...P}=w,p={[u]:h,...j};return{[k]:{...p},...P}}return w!==void 0?{[k]:{[u]:h},...w}:{[k]:{[u]:h}}};await this.addBurnInputsIfNeeded(),Array.from(this._totalMints,t=>({unit:t[0],data:t[1]})).reduce((t,w)=>t.set(w.data.label,i(w,t.get(w.data.label))),new Map).forEach((t,w)=>{this._txBuilder.add_json_metadatum(y.exports.BigNum.from_str(w),JSON.stringify(t))}),this.addMintOutputs()}async filterAvailableUTxOs(i=[]){return this._initiator===void 0?[]:(await this._initiator.getUsedUTxOs()).filter(w=>i.find(u=>u.input.txHash===w.input().transaction_id().to_hex())===void 0)}addMintOutputs(){this._recipients.forEach((i,t)=>{const u=Ee(i).multiasset();if(u!==void 0){const k=Fr(t).next().with_asset_and_min_required_coin_by_utxo_cost(u,on(this._protocolParameters.coinsPerUTxOSize)).build();this._txBuilder.add_output(k)}})}notVisited(i){return this.__visits.includes(i)===!1}setTxOutput(i){const w=y.exports.BigNum.from_str(this._txOutputs.get(i.unit)??"0").checked_add(y.exports.BigNum.from_str(i.quantity)).to_str();this._txOutputs.set(i.unit,w)}};Ve([er()],exports.Transaction.prototype,"mintAsset",null);Ve([er()],exports.Transaction.prototype,"redeemValue",null);Ve([er()],exports.Transaction.prototype,"sendAssets",null);Ve([er()],exports.Transaction.prototype,"sendValue",null);Ve([er()],exports.Transaction.prototype,"setCollateral",null);Ve([er()],exports.Transaction.prototype,"setRequiredSigners",null);Ve([er()],exports.Transaction.prototype,"setTxInputs",null);exports.Transaction=Ve([mo],exports.Transaction);var _r={exports:{}},Ca={exports:{}},Cn={exports:{}};(function(c){(function(i){var t,w=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,h=Math.floor,k="[BigNumber Error] ",j=k+"Number primitive has more than 15 significant digits: ",P=1e14,p=14,V=9007199254740991,G=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],R=1e7,m=1e9;function $(Z){var g,D,Q,J=I.prototype={constructor:I,toString:null,valueOf:null},ct=new I(1),ut=20,xt=4,At=-7,pt=21,It=-1e7,Ut=1e7,Dt=!1,Pt=1,qt=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",z=!0;function I(x,A){var B,N,S,T,M,E,O,F,U=this;if(!(U instanceof I))return new I(x,A);if(A==null){if(x&&x._isBigNumber===!0){U.s=x.s,!x.c||x.e>Ut?U.c=U.e=null:x.e<It?U.c=[U.e=0]:(U.e=x.e,U.c=x.c.slice());return}if((E=typeof x=="number")&&x*0==0){if(U.s=1/x<0?(x=-x,-1):1,x===~~x){for(T=0,M=x;M>=10;M/=10,T++);T>Ut?U.c=U.e=null:(U.e=T,U.c=[x]);return}F=String(x)}else{if(!w.test(F=String(x)))return Q(U,F,E);U.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(T=F.indexOf("."))>-1&&(F=F.replace(".","")),(M=F.search(/e/i))>0?(T<0&&(T=M),T+=+F.slice(M+1),F=F.substring(0,M)):T<0&&(T=F.length)}else{if(v(A,2,q.length,"Base"),A==10&&z)return U=new I(x),et(U,ut+U.e+1,xt);if(F=String(x),E=typeof x=="number"){if(x*0!=0)return Q(U,F,E,A);if(U.s=1/x<0?(F=F.slice(1),-1):1,I.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(j+x)}else U.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(B=q.slice(0,A),T=M=0,O=F.length;M<O;M++)if(B.indexOf(N=F.charAt(M))<0){if(N=="."){if(M>T){T=O;continue}}else if(!S&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){S=!0,M=-1,T=0;continue}return Q(U,String(x),E,A)}E=!1,F=D(F,A,10,U.s),(T=F.indexOf("."))>-1?F=F.replace(".",""):T=F.length}for(M=0;F.charCodeAt(M)===48;M++);for(O=F.length;F.charCodeAt(--O)===48;);if(F=F.slice(M,++O)){if(O-=M,E&&I.DEBUG&&O>15&&(x>V||x!==h(x)))throw Error(j+U.s*x);if((T=T-M-1)>Ut)U.c=U.e=null;else if(T<It)U.c=[U.e=0];else{if(U.e=T,U.c=[],M=(T+1)%p,T<0&&(M+=p),M<O){for(M&&U.c.push(+F.slice(0,M)),O-=p;M<O;)U.c.push(+F.slice(M,M+=p));M=p-(F=F.slice(M)).length}else M-=O;for(;M--;F+="0");U.c.push(+F)}}else U.c=[U.e=0]}I.clone=$,I.ROUND_UP=0,I.ROUND_DOWN=1,I.ROUND_CEIL=2,I.ROUND_FLOOR=3,I.ROUND_HALF_UP=4,I.ROUND_HALF_DOWN=5,I.ROUND_HALF_EVEN=6,I.ROUND_HALF_CEIL=7,I.ROUND_HALF_FLOOR=8,I.EUCLID=9,I.config=I.set=function(x){var A,B;if(x!=null)if(typeof x=="object"){if(x.hasOwnProperty(A="DECIMAL_PLACES")&&(B=x[A],v(B,0,m,A),ut=B),x.hasOwnProperty(A="ROUNDING_MODE")&&(B=x[A],v(B,0,8,A),xt=B),x.hasOwnProperty(A="EXPONENTIAL_AT")&&(B=x[A],B&&B.pop?(v(B[0],-m,0,A),v(B[1],0,m,A),At=B[0],pt=B[1]):(v(B,-m,m,A),At=-(pt=B<0?-B:B))),x.hasOwnProperty(A="RANGE"))if(B=x[A],B&&B.pop)v(B[0],-m,-1,A),v(B[1],1,m,A),It=B[0],Ut=B[1];else if(v(B,-m,m,A),B)It=-(Ut=B<0?-B:B);else throw Error(k+A+" cannot be zero: "+B);if(x.hasOwnProperty(A="CRYPTO"))if(B=x[A],B===!!B)if(B)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Dt=B;else throw Dt=!B,Error(k+"crypto unavailable");else Dt=B;else throw Error(k+A+" not true or false: "+B);if(x.hasOwnProperty(A="MODULO_MODE")&&(B=x[A],v(B,0,9,A),Pt=B),x.hasOwnProperty(A="POW_PRECISION")&&(B=x[A],v(B,0,m,A),qt=B),x.hasOwnProperty(A="FORMAT"))if(B=x[A],typeof B=="object")K=B;else throw Error(k+A+" not an object: "+B);if(x.hasOwnProperty(A="ALPHABET"))if(B=x[A],typeof B=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(B))z=B.slice(0,10)=="0123456789",q=B;else throw Error(k+A+" invalid: "+B)}else throw Error(k+"Object expected: "+x);return{DECIMAL_PLACES:ut,ROUNDING_MODE:xt,EXPONENTIAL_AT:[At,pt],RANGE:[It,Ut],CRYPTO:Dt,MODULO_MODE:Pt,POW_PRECISION:qt,FORMAT:K,ALPHABET:q}},I.isBigNumber=function(x){if(!x||x._isBigNumber!==!0)return!1;if(!I.DEBUG)return!0;var A,B,N=x.c,S=x.e,T=x.s;t:if({}.toString.call(N)=="[object Array]"){if((T===1||T===-1)&&S>=-m&&S<=m&&S===h(S)){if(N[0]===0){if(S===0&&N.length===1)return!0;break t}if(A=(S+1)%p,A<1&&(A+=p),String(N[0]).length==A){for(A=0;A<N.length;A++)if(B=N[A],B<0||B>=P||B!==h(B))break t;if(B!==0)return!0}}}else if(N===null&&S===null&&(T===null||T===1||T===-1))return!0;throw Error(k+"Invalid BigNumber: "+x)},I.maximum=I.max=function(){return bt(arguments,-1)},I.minimum=I.min=function(){return bt(arguments,1)},I.random=function(){var x=9007199254740992,A=Math.random()*x&2097151?function(){return h(Math.random()*x)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(B){var N,S,T,M,E,O=0,F=[],U=new I(ct);if(B==null?B=ut:v(B,0,m),M=u(B/p),Dt)if(crypto.getRandomValues){for(N=crypto.getRandomValues(new Uint32Array(M*=2));O<M;)E=N[O]*131072+(N[O+1]>>>11),E>=9e15?(S=crypto.getRandomValues(new Uint32Array(2)),N[O]=S[0],N[O+1]=S[1]):(F.push(E%1e14),O+=2);O=M/2}else if(crypto.randomBytes){for(N=crypto.randomBytes(M*=7);O<M;)E=(N[O]&31)*281474976710656+N[O+1]*1099511627776+N[O+2]*4294967296+N[O+3]*16777216+(N[O+4]<<16)+(N[O+5]<<8)+N[O+6],E>=9e15?crypto.randomBytes(7).copy(N,O):(F.push(E%1e14),O+=7);O=M/7}else throw Dt=!1,Error(k+"crypto unavailable");if(!Dt)for(;O<M;)E=A(),E<9e15&&(F[O++]=E%1e14);for(M=F[--O],B%=p,M&&B&&(E=G[p-B],F[O]=h(M/E)*E);F[O]===0;F.pop(),O--);if(O<0)F=[T=0];else{for(T=-1;F[0]===0;F.splice(0,1),T-=p);for(O=1,E=F[0];E>=10;E/=10,O++);O<p&&(T-=p-O)}return U.e=T,U.c=F,U}}(),I.sum=function(){for(var x=1,A=arguments,B=new I(A[0]);x<A.length;)B=B.plus(A[x++]);return B},D=function(){var x="0123456789";function A(B,N,S,T){for(var M,E=[0],O,F=0,U=B.length;F<U;){for(O=E.length;O--;E[O]*=N);for(E[0]+=T.indexOf(B.charAt(F++)),M=0;M<E.length;M++)E[M]>S-1&&(E[M+1]==null&&(E[M+1]=0),E[M+1]+=E[M]/S|0,E[M]%=S)}return E.reverse()}return function(B,N,S,T,M){var E,O,F,U,L,X,tt,it,Bt=B.indexOf("."),vt=ut,at=xt;for(Bt>=0&&(U=qt,qt=0,B=B.replace(".",""),it=new I(N),X=it.pow(B.length-Bt),qt=U,it.c=A(a(_t(X.c),X.e,"0"),10,S,x),it.e=it.c.length),tt=A(B,N,S,M?(E=q,x):(E=x,q)),F=U=tt.length;tt[--U]==0;tt.pop());if(!tt[0])return E.charAt(0);if(Bt<0?--F:(X.c=tt,X.e=F,X.s=T,X=g(X,it,vt,at,S),tt=X.c,L=X.r,F=X.e),O=F+vt+1,Bt=tt[O],U=S/2,L=L||O<0||tt[O+1]!=null,L=at<4?(Bt!=null||L)&&(at==0||at==(X.s<0?3:2)):Bt>U||Bt==U&&(at==4||L||at==6&&tt[O-1]&1||at==(X.s<0?8:7)),O<1||!tt[0])B=L?a(E.charAt(1),-vt,E.charAt(0)):E.charAt(0);else{if(tt.length=O,L)for(--S;++tt[--O]>S;)tt[O]=0,O||(++F,tt=[1].concat(tt));for(U=tt.length;!tt[--U];);for(Bt=0,B="";Bt<=U;B+=E.charAt(tt[Bt++]));B=a(B,F,E.charAt(0))}return B}}(),g=function(){function x(N,S,T){var M,E,O,F,U=0,L=N.length,X=S%R,tt=S/R|0;for(N=N.slice();L--;)O=N[L]%R,F=N[L]/R|0,M=tt*O+F*X,E=X*O+M%R*R+U,U=(E/T|0)+(M/R|0)+tt*F,N[L]=E%T;return U&&(N=[U].concat(N)),N}function A(N,S,T,M){var E,O;if(T!=M)O=T>M?1:-1;else for(E=O=0;E<T;E++)if(N[E]!=S[E]){O=N[E]>S[E]?1:-1;break}return O}function B(N,S,T,M){for(var E=0;T--;)N[T]-=E,E=N[T]<S[T]?1:0,N[T]=E*M+N[T]-S[T];for(;!N[0]&&N.length>1;N.splice(0,1));}return function(N,S,T,M,E){var O,F,U,L,X,tt,it,Bt,vt,at,ht,Ot,i_,Xt,w_,Rt,__,Ft=N.s==S.s?1:-1,Kt=N.c,Et=S.c;if(!Kt||!Kt[0]||!Et||!Et[0])return new I(!N.s||!S.s||(Kt?Et&&Kt[0]==Et[0]:!Et)?NaN:Kt&&Kt[0]==0||!Et?Ft*0:Ft/0);for(Bt=new I(Ft),vt=Bt.c=[],F=N.e-S.e,Ft=T+F+1,E||(E=P,F=b(N.e/p)-b(S.e/p),Ft=Ft/p|0),U=0;Et[U]==(Kt[U]||0);U++);if(Et[U]>(Kt[U]||0)&&F--,Ft<0)vt.push(1),L=!0;else{for(Xt=Kt.length,Rt=Et.length,U=0,Ft+=2,X=h(E/(Et[0]+1)),X>1&&(Et=x(Et,X,E),Kt=x(Kt,X,E),Rt=Et.length,Xt=Kt.length),i_=Rt,at=Kt.slice(0,Rt),ht=at.length;ht<Rt;at[ht++]=0);__=Et.slice(),__=[0].concat(__),w_=Et[0],Et[1]>=E/2&&w_++;do{if(X=0,O=A(Et,at,Rt,ht),O<0){if(Ot=at[0],Rt!=ht&&(Ot=Ot*E+(at[1]||0)),X=h(Ot/w_),X>1)for(X>=E&&(X=E-1),tt=x(Et,X,E),it=tt.length,ht=at.length;A(tt,at,it,ht)==1;)X--,B(tt,Rt<it?__:Et,it,E),it=tt.length,O=1;else X==0&&(O=X=1),tt=Et.slice(),it=tt.length;if(it<ht&&(tt=[0].concat(tt)),B(at,tt,ht,E),ht=at.length,O==-1)for(;A(Et,at,Rt,ht)<1;)X++,B(at,Rt<ht?__:Et,ht,E),ht=at.length}else O===0&&(X++,at=[0]);vt[U++]=X,at[0]?at[ht++]=Kt[i_]||0:(at=[Kt[i_]],ht=1)}while((i_++<Xt||at[0]!=null)&&Ft--);L=at[0]!=null,vt[0]||vt.splice(0,1)}if(E==P){for(U=1,Ft=vt[0];Ft>=10;Ft/=10,U++);et(Bt,T+(Bt.e=U+F*p-1)+1,M,L)}else Bt.e=F,Bt.r=+L;return Bt}}();function wt(x,A,B,N){var S,T,M,E,O;if(B==null?B=xt:v(B,0,8),!x.c)return x.toString();if(S=x.c[0],M=x.e,A==null)O=_t(x.c),O=N==1||N==2&&(M<=At||M>=pt)?ft(O,M):a(O,M,"0");else if(x=et(new I(x),A,B),T=x.e,O=_t(x.c),E=O.length,N==1||N==2&&(A<=T||T<=At)){for(;E<A;O+="0",E++);O=ft(O,T)}else if(A-=M,O=a(O,T,"0"),T+1>E){if(--A>0)for(O+=".";A--;O+="0");}else if(A+=T-E,A>0)for(T+1==E&&(O+=".");A--;O+="0");return x.s<0&&S?"-"+O:O}function bt(x,A){for(var B,N,S=1,T=new I(x[0]);S<x.length;S++)N=new I(x[S]),(!N.s||(B=W(T,N))===A||B===0&&T.s===A)&&(T=N);return T}function st(x,A,B){for(var N=1,S=A.length;!A[--S];A.pop());for(S=A[0];S>=10;S/=10,N++);return(B=N+B*p-1)>Ut?x.c=x.e=null:B<It?x.c=[x.e=0]:(x.e=B,x.c=A),x}Q=function(){var x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,B=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,S=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(T,M,E,O){var F,U=E?M:M.replace(S,"");if(N.test(U))T.s=isNaN(U)?null:U<0?-1:1;else{if(!E&&(U=U.replace(x,function(L,X,tt){return F=(tt=tt.toLowerCase())=="x"?16:tt=="b"?2:8,!O||O==F?X:L}),O&&(F=O,U=U.replace(A,"$1").replace(B,"0.$1")),M!=U))return new I(U,F);if(I.DEBUG)throw Error(k+"Not a"+(O?" base "+O:"")+" number: "+M);T.s=null}T.c=T.e=null}}();function et(x,A,B,N){var S,T,M,E,O,F,U,L=x.c,X=G;if(L){t:{for(S=1,E=L[0];E>=10;E/=10,S++);if(T=A-S,T<0)T+=p,M=A,O=L[F=0],U=h(O/X[S-M-1]%10);else if(F=u((T+1)/p),F>=L.length)if(N){for(;L.length<=F;L.push(0));O=U=0,S=1,T%=p,M=T-p+1}else break t;else{for(O=E=L[F],S=1;E>=10;E/=10,S++);T%=p,M=T-p+S,U=M<0?0:h(O/X[S-M-1]%10)}if(N=N||A<0||L[F+1]!=null||(M<0?O:O%X[S-M-1]),N=B<4?(U||N)&&(B==0||B==(x.s<0?3:2)):U>5||U==5&&(B==4||N||B==6&&(T>0?M>0?O/X[S-M]:0:L[F-1])%10&1||B==(x.s<0?8:7)),A<1||!L[0])return L.length=0,N?(A-=x.e+1,L[0]=X[(p-A%p)%p],x.e=-A||0):L[0]=x.e=0,x;if(T==0?(L.length=F,E=1,F--):(L.length=F+1,E=X[p-T],L[F]=M>0?h(O/X[S-M]%X[M])*E:0),N)for(;;)if(F==0){for(T=1,M=L[0];M>=10;M/=10,T++);for(M=L[0]+=E,E=1;M>=10;M/=10,E++);T!=E&&(x.e++,L[0]==P&&(L[0]=1));break}else{if(L[F]+=E,L[F]!=P)break;L[F--]=0,E=1}for(T=L.length;L[--T]===0;L.pop());}x.e>Ut?x.c=x.e=null:x.e<It&&(x.c=[x.e=0])}return x}function ot(x){var A,B=x.e;return B===null?x.toString():(A=_t(x.c),A=B<=At||B>=pt?ft(A,B):a(A,B,"0"),x.s<0?"-"+A:A)}return J.absoluteValue=J.abs=function(){var x=new I(this);return x.s<0&&(x.s=1),x},J.comparedTo=function(x,A){return W(this,new I(x,A))},J.decimalPlaces=J.dp=function(x,A){var B,N,S,T=this;if(x!=null)return v(x,0,m),A==null?A=xt:v(A,0,8),et(new I(T),x+T.e+1,A);if(!(B=T.c))return null;if(N=((S=B.length-1)-b(this.e/p))*p,S=B[S])for(;S%10==0;S/=10,N--);return N<0&&(N=0),N},J.dividedBy=J.div=function(x,A){return g(this,new I(x,A),ut,xt)},J.dividedToIntegerBy=J.idiv=function(x,A){return g(this,new I(x,A),0,1)},J.exponentiatedBy=J.pow=function(x,A){var B,N,S,T,M,E,O,F,U,L=this;if(x=new I(x),x.c&&!x.isInteger())throw Error(k+"Exponent not an integer: "+ot(x));if(A!=null&&(A=new I(A)),E=x.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!x.c||!x.c[0])return U=new I(Math.pow(+ot(L),E?x.s*(2-nt(x)):+ot(x))),A?U.mod(A):U;if(O=x.s<0,A){if(A.c?!A.c[0]:!A.s)return new I(NaN);N=!O&&L.isInteger()&&A.isInteger(),N&&(L=L.mod(A))}else{if(x.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||E&&L.c[1]>=24e7:L.c[0]<8e13||E&&L.c[0]<=9999975e7)))return T=L.s<0&&nt(x)?-0:0,L.e>-1&&(T=1/T),new I(O?1/T:T);qt&&(T=u(qt/p+2))}for(E?(B=new I(.5),O&&(x.s=1),F=nt(x)):(S=Math.abs(+ot(x)),F=S%2),U=new I(ct);;){if(F){if(U=U.times(L),!U.c)break;T?U.c.length>T&&(U.c.length=T):N&&(U=U.mod(A))}if(S){if(S=h(S/2),S===0)break;F=S%2}else if(x=x.times(B),et(x,x.e+1,1),x.e>14)F=nt(x);else{if(S=+ot(x),S===0)break;F=S%2}L=L.times(L),T?L.c&&L.c.length>T&&(L.c.length=T):N&&(L=L.mod(A))}return N?U:(O&&(U=ct.div(U)),A?U.mod(A):T?et(U,qt,xt,M):U)},J.integerValue=function(x){var A=new I(this);return x==null?x=xt:v(x,0,8),et(A,A.e+1,x)},J.isEqualTo=J.eq=function(x,A){return W(this,new I(x,A))===0},J.isFinite=function(){return!!this.c},J.isGreaterThan=J.gt=function(x,A){return W(this,new I(x,A))>0},J.isGreaterThanOrEqualTo=J.gte=function(x,A){return(A=W(this,new I(x,A)))===1||A===0},J.isInteger=function(){return!!this.c&&b(this.e/p)>this.c.length-2},J.isLessThan=J.lt=function(x,A){return W(this,new I(x,A))<0},J.isLessThanOrEqualTo=J.lte=function(x,A){return(A=W(this,new I(x,A)))===-1||A===0},J.isNaN=function(){return!this.s},J.isNegative=function(){return this.s<0},J.isPositive=function(){return this.s>0},J.isZero=function(){return!!this.c&&this.c[0]==0},J.minus=function(x,A){var B,N,S,T,M=this,E=M.s;if(x=new I(x,A),A=x.s,!E||!A)return new I(NaN);if(E!=A)return x.s=-A,M.plus(x);var O=M.e/p,F=x.e/p,U=M.c,L=x.c;if(!O||!F){if(!U||!L)return U?(x.s=-A,x):new I(L?M:NaN);if(!U[0]||!L[0])return L[0]?(x.s=-A,x):new I(U[0]?M:xt==3?-0:0)}if(O=b(O),F=b(F),U=U.slice(),E=O-F){for((T=E<0)?(E=-E,S=U):(F=O,S=L),S.reverse(),A=E;A--;S.push(0));S.reverse()}else for(N=(T=(E=U.length)<(A=L.length))?E:A,E=A=0;A<N;A++)if(U[A]!=L[A]){T=U[A]<L[A];break}if(T&&(S=U,U=L,L=S,x.s=-x.s),A=(N=L.length)-(B=U.length),A>0)for(;A--;U[B++]=0);for(A=P-1;N>E;){if(U[--N]<L[N]){for(B=N;B&&!U[--B];U[B]=A);--U[B],U[N]+=P}U[N]-=L[N]}for(;U[0]==0;U.splice(0,1),--F);return U[0]?st(x,U,F):(x.s=xt==3?-1:1,x.c=[x.e=0],x)},J.modulo=J.mod=function(x,A){var B,N,S=this;return x=new I(x,A),!S.c||!x.s||x.c&&!x.c[0]?new I(NaN):!x.c||S.c&&!S.c[0]?new I(S):(Pt==9?(N=x.s,x.s=1,B=g(S,x,0,3),x.s=N,B.s*=N):B=g(S,x,0,Pt),x=S.minus(B.times(x)),!x.c[0]&&Pt==1&&(x.s=S.s),x)},J.multipliedBy=J.times=function(x,A){var B,N,S,T,M,E,O,F,U,L,X,tt,it,Bt,vt,at=this,ht=at.c,Ot=(x=new I(x,A)).c;if(!ht||!Ot||!ht[0]||!Ot[0])return!at.s||!x.s||ht&&!ht[0]&&!Ot||Ot&&!Ot[0]&&!ht?x.c=x.e=x.s=null:(x.s*=at.s,!ht||!Ot?x.c=x.e=null:(x.c=[0],x.e=0)),x;for(N=b(at.e/p)+b(x.e/p),x.s*=at.s,O=ht.length,L=Ot.length,O<L&&(it=ht,ht=Ot,Ot=it,S=O,O=L,L=S),S=O+L,it=[];S--;it.push(0));for(Bt=P,vt=R,S=L;--S>=0;){for(B=0,X=Ot[S]%vt,tt=Ot[S]/vt|0,M=O,T=S+M;T>S;)F=ht[--M]%vt,U=ht[M]/vt|0,E=tt*F+U*X,F=X*F+E%vt*vt+it[T]+B,B=(F/Bt|0)+(E/vt|0)+tt*U,it[T--]=F%Bt;it[T]=B}return B?++N:it.splice(0,1),st(x,it,N)},J.negated=function(){var x=new I(this);return x.s=-x.s||null,x},J.plus=function(x,A){var B,N=this,S=N.s;if(x=new I(x,A),A=x.s,!S||!A)return new I(NaN);if(S!=A)return x.s=-A,N.minus(x);var T=N.e/p,M=x.e/p,E=N.c,O=x.c;if(!T||!M){if(!E||!O)return new I(S/0);if(!E[0]||!O[0])return O[0]?x:new I(E[0]?N:S*0)}if(T=b(T),M=b(M),E=E.slice(),S=T-M){for(S>0?(M=T,B=O):(S=-S,B=E),B.reverse();S--;B.push(0));B.reverse()}for(S=E.length,A=O.length,S-A<0&&(B=O,O=E,E=B,A=S),S=0;A;)S=(E[--A]=E[A]+O[A]+S)/P|0,E[A]=P===E[A]?0:E[A]%P;return S&&(E=[S].concat(E),++M),st(x,E,M)},J.precision=J.sd=function(x,A){var B,N,S,T=this;if(x!=null&&x!==!!x)return v(x,1,m),A==null?A=xt:v(A,0,8),et(new I(T),x,A);if(!(B=T.c))return null;if(S=B.length-1,N=S*p+1,S=B[S]){for(;S%10==0;S/=10,N--);for(S=B[0];S>=10;S/=10,N++);}return x&&T.e+1>N&&(N=T.e+1),N},J.shiftedBy=function(x){return v(x,-V,V),this.times("1e"+x)},J.squareRoot=J.sqrt=function(){var x,A,B,N,S,T=this,M=T.c,E=T.s,O=T.e,F=ut+4,U=new I("0.5");if(E!==1||!M||!M[0])return new I(!E||E<0&&(!M||M[0])?NaN:M?T:1/0);if(E=Math.sqrt(+ot(T)),E==0||E==1/0?(A=_t(M),(A.length+O)%2==0&&(A+="0"),E=Math.sqrt(+A),O=b((O+1)/2)-(O<0||O%2),E==1/0?A="5e"+O:(A=E.toExponential(),A=A.slice(0,A.indexOf("e")+1)+O),B=new I(A)):B=new I(E+""),B.c[0]){for(O=B.e,E=O+F,E<3&&(E=0);;)if(S=B,B=U.times(S.plus(g(T,S,F,1))),_t(S.c).slice(0,E)===(A=_t(B.c)).slice(0,E))if(B.e<O&&--E,A=A.slice(E-3,E+1),A=="9999"||!N&&A=="4999"){if(!N&&(et(S,S.e+ut+2,0),S.times(S).eq(T))){B=S;break}F+=4,E+=4,N=1}else{(!+A||!+A.slice(1)&&A.charAt(0)=="5")&&(et(B,B.e+ut+2,1),x=!B.times(B).eq(T));break}}return et(B,B.e+ut+1,xt,x)},J.toExponential=function(x,A){return x!=null&&(v(x,0,m),x++),wt(this,x,A,1)},J.toFixed=function(x,A){return x!=null&&(v(x,0,m),x=x+this.e+1),wt(this,x,A)},J.toFormat=function(x,A,B){var N,S=this;if(B==null)x!=null&&A&&typeof A=="object"?(B=A,A=null):x&&typeof x=="object"?(B=x,x=A=null):B=K;else if(typeof B!="object")throw Error(k+"Argument not an object: "+B);if(N=S.toFixed(x,A),S.c){var T,M=N.split("."),E=+B.groupSize,O=+B.secondaryGroupSize,F=B.groupSeparator||"",U=M[0],L=M[1],X=S.s<0,tt=X?U.slice(1):U,it=tt.length;if(O&&(T=E,E=O,O=T,it-=T),E>0&&it>0){for(T=it%E||E,U=tt.substr(0,T);T<it;T+=E)U+=F+tt.substr(T,E);O>0&&(U+=F+tt.slice(T)),X&&(U="-"+U)}N=L?U+(B.decimalSeparator||"")+((O=+B.fractionGroupSize)?L.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(B.fractionGroupSeparator||"")):L):U}return(B.prefix||"")+N+(B.suffix||"")},J.toFraction=function(x){var A,B,N,S,T,M,E,O,F,U,L,X,tt=this,it=tt.c;if(x!=null&&(E=new I(x),!E.isInteger()&&(E.c||E.s!==1)||E.lt(ct)))throw Error(k+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+ot(E));if(!it)return new I(tt);for(A=new I(ct),F=B=new I(ct),N=O=new I(ct),X=_t(it),T=A.e=X.length-tt.e-1,A.c[0]=G[(M=T%p)<0?p+M:M],x=!x||E.comparedTo(A)>0?T>0?A:F:E,M=Ut,Ut=1/0,E=new I(X),O.c[0]=0;U=g(E,A,0,1),S=B.plus(U.times(N)),S.comparedTo(x)!=1;)B=N,N=S,F=O.plus(U.times(S=F)),O=S,A=E.minus(U.times(S=A)),E=S;return S=g(x.minus(B),N,0,1),O=O.plus(S.times(F)),B=B.plus(S.times(N)),O.s=F.s=tt.s,T=T*2,L=g(F,N,T,xt).minus(tt).abs().comparedTo(g(O,B,T,xt).minus(tt).abs())<1?[F,N]:[O,B],Ut=M,L},J.toNumber=function(){return+ot(this)},J.toPrecision=function(x,A){return x!=null&&v(x,1,m),wt(this,x,A,2)},J.toString=function(x){var A,B=this,N=B.s,S=B.e;return S===null?N?(A="Infinity",N<0&&(A="-"+A)):A="NaN":(x==null?A=S<=At||S>=pt?ft(_t(B.c),S):a(_t(B.c),S,"0"):x===10&&z?(B=et(new I(B),ut+S+1,xt),A=a(_t(B.c),B.e,"0")):(v(x,2,q.length,"Base"),A=D(a(_t(B.c),S,"0"),10,x,N,!0)),N<0&&B.c[0]&&(A="-"+A)),A},J.valueOf=J.toJSON=function(){return ot(this)},J._isBigNumber=!0,Z!=null&&I.set(Z),I}function b(Z){var g=Z|0;return Z>0||Z===g?g:g-1}function _t(Z){for(var g,D,Q=1,J=Z.length,ct=Z[0]+"";Q<J;){for(g=Z[Q++]+"",D=p-g.length;D--;g="0"+g);ct+=g}for(J=ct.length;ct.charCodeAt(--J)===48;);return ct.slice(0,J+1||1)}function W(Z,g){var D,Q,J=Z.c,ct=g.c,ut=Z.s,xt=g.s,At=Z.e,pt=g.e;if(!ut||!xt)return null;if(D=J&&!J[0],Q=ct&&!ct[0],D||Q)return D?Q?0:-xt:ut;if(ut!=xt)return ut;if(D=ut<0,Q=At==pt,!J||!ct)return Q?0:!J^D?1:-1;if(!Q)return At>pt^D?1:-1;for(xt=(At=J.length)<(pt=ct.length)?At:pt,ut=0;ut<xt;ut++)if(J[ut]!=ct[ut])return J[ut]>ct[ut]^D?1:-1;return At==pt?0:At>pt^D?1:-1}function v(Z,g,D,Q){if(Z<g||Z>D||Z!==h(Z))throw Error(k+(Q||"Argument")+(typeof Z=="number"?Z<g||Z>D?" out of range: ":" not an integer: ":" not a primitive number: ")+String(Z))}function nt(Z){var g=Z.c.length-1;return b(Z.e/p)==g&&Z.c[g]%2!=0}function ft(Z,g){return(Z.length>1?Z.charAt(0)+"."+Z.slice(1):Z)+(g<0?"e":"e+")+g}function a(Z,g,D){var Q,J;if(g<0){for(J=D+".";++g;J+=D);Z=J+Z}else if(Q=Z.length,++g>Q){for(J=D,g-=Q;--g;J+=D);Z+=J}else g<Q&&(Z=Z.slice(0,g)+"."+Z.slice(g));return Z}t=$(),t.default=t.BigNumber=t,c.exports?c.exports=t:(i||(i=typeof self<"u"&&self?self:window),i.BigNumber=t)})(zr)})(Cn);(function(c){var i=Cn.exports,t=c.exports;(function(){var w=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u,h,k={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j;function P(V){return w.lastIndex=0,w.test(V)?'"'+V.replace(w,function(G){var R=k[G];return typeof R=="string"?R:"\\u"+("0000"+G.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+V+'"'}function p(V,G){var R,m,$,b,_t=u,W,v=G[V],nt=v!=null&&(v instanceof i||i.isBigNumber(v));switch(v&&typeof v=="object"&&typeof v.toJSON=="function"&&(v=v.toJSON(V)),typeof j=="function"&&(v=j.call(G,V,v)),typeof v){case"string":return nt?v:P(v);case"number":return isFinite(v)?String(v):"null";case"boolean":case"null":case"bigint":return String(v);case"object":if(!v)return"null";if(u+=h,W=[],Object.prototype.toString.apply(v)==="[object Array]"){for(b=v.length,R=0;R<b;R+=1)W[R]=p(R,v)||"null";return $=W.length===0?"[]":u?`[
|
|
12
|
+
`+u+W.join(`,
|
|
13
|
+
`+u)+`
|
|
14
|
+
`+_t+"]":"["+W.join(",")+"]",u=_t,$}if(j&&typeof j=="object")for(b=j.length,R=0;R<b;R+=1)typeof j[R]=="string"&&(m=j[R],$=p(m,v),$&&W.push(P(m)+(u?": ":":")+$));else Object.keys(v).forEach(function(ft){var a=p(ft,v);a&&W.push(P(ft)+(u?": ":":")+a)});return $=W.length===0?"{}":u?`{
|
|
15
|
+
`+u+W.join(`,
|
|
16
|
+
`+u)+`
|
|
17
|
+
`+_t+"}":"{"+W.join(",")+"}",u=_t,$}}typeof t.stringify!="function"&&(t.stringify=function(V,G,R){var m;if(u="",h="",typeof R=="number")for(m=0;m<R;m+=1)h+=" ";else typeof R=="string"&&(h=R);if(j=G,G&&typeof G!="function"&&(typeof G!="object"||typeof G.length!="number"))throw new Error("JSON.stringify");return p("",{"":V})})})()})(Ca);var Kr=null;const ko=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,xo=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;var Ao=function(c){var i={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(c!=null){if(c.strict===!0&&(i.strict=!0),c.storeAsString===!0&&(i.storeAsString=!0),i.alwaysParseAsBig=c.alwaysParseAsBig===!0?c.alwaysParseAsBig:!1,i.useNativeBigInt=c.useNativeBigInt===!0?c.useNativeBigInt:!1,typeof c.constructorAction<"u")if(c.constructorAction==="error"||c.constructorAction==="ignore"||c.constructorAction==="preserve")i.constructorAction=c.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${c.constructorAction}`);if(typeof c.protoAction<"u")if(c.protoAction==="error"||c.protoAction==="ignore"||c.protoAction==="preserve")i.protoAction=c.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${c.protoAction}`)}var t,w,u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
18
|
+
`,r:"\r",t:" "},h,k=function(b){throw{name:"SyntaxError",message:b,at:t,text:h}},j=function(b){return b&&b!==w&&k("Expected '"+b+"' instead of '"+w+"'"),w=h.charAt(t),t+=1,w},P=function(){var b,_t="";for(w==="-"&&(_t="-",j("-"));w>="0"&&w<="9";)_t+=w,j();if(w===".")for(_t+=".";j()&&w>="0"&&w<="9";)_t+=w;if(w==="e"||w==="E")for(_t+=w,j(),(w==="-"||w==="+")&&(_t+=w,j());w>="0"&&w<="9";)_t+=w,j();if(b=+_t,!isFinite(b))k("Bad number");else return Kr==null&&(Kr=Cn.exports),_t.length>15?i.storeAsString?_t:i.useNativeBigInt?BigInt(_t):new Kr(_t):i.alwaysParseAsBig?i.useNativeBigInt?BigInt(b):new Kr(b):b},p=function(){var b,_t,W="",v;if(w==='"')for(var nt=t;j();){if(w==='"')return t-1>nt&&(W+=h.substring(nt,t-1)),j(),W;if(w==="\\"){if(t-1>nt&&(W+=h.substring(nt,t-1)),j(),w==="u"){for(v=0,_t=0;_t<4&&(b=parseInt(j(),16),!!isFinite(b));_t+=1)v=v*16+b;W+=String.fromCharCode(v)}else if(typeof u[w]=="string")W+=u[w];else break;nt=t}}k("Bad string")},V=function(){for(;w&&w<=" ";)j()},G=function(){switch(w){case"t":return j("t"),j("r"),j("u"),j("e"),!0;case"f":return j("f"),j("a"),j("l"),j("s"),j("e"),!1;case"n":return j("n"),j("u"),j("l"),j("l"),null}k("Unexpected '"+w+"'")},R,m=function(){var b=[];if(w==="["){if(j("["),V(),w==="]")return j("]"),b;for(;w;){if(b.push(R()),V(),w==="]")return j("]"),b;j(","),V()}}k("Bad array")},$=function(){var b,_t=Object.create(null);if(w==="{"){if(j("{"),V(),w==="}")return j("}"),_t;for(;w;){if(b=p(),V(),j(":"),i.strict===!0&&Object.hasOwnProperty.call(_t,b)&&k('Duplicate key "'+b+'"'),ko.test(b)===!0?i.protoAction==="error"?k("Object contains forbidden prototype property"):i.protoAction==="ignore"?R():_t[b]=R():xo.test(b)===!0?i.constructorAction==="error"?k("Object contains forbidden constructor property"):i.constructorAction==="ignore"?R():_t[b]=R():_t[b]=R(),V(),w==="}")return j("}"),_t;j(","),V()}}k("Bad object")};return R=function(){switch(V(),w){case"{":return $();case"[":return m();case'"':return p();case"-":return P();default:return w>="0"&&w<="9"?P():G()}},function(b,_t){var W;return h=b+"",t=0,w=" ",W=R(),V(),w&&k("Syntax error"),typeof _t=="function"?function v(nt,ft){var a,Z=nt[ft];return Z&&typeof Z=="object"&&Object.keys(Z).forEach(function(g){a=v(Z,g),a!==void 0?Z[g]=a:delete Z[g]}),_t.call(nt,ft,Z)}({"":W},""):W}},Io=Ao,ja=Ca.exports.stringify,Ba=Io;_r.exports=function(c){return{parse:Ba(c),stringify:ja}};_r.exports.parse=Ba();_r.exports.stringify=ja;const Ea=()=>({inputs:[],outputs:[],extraInputs:[],selectionThreshold:0,collaterals:[],requiredSignatures:[],referenceInputs:[],mints:[],changeAddress:"",metadata:[],validityRange:{},certificates:[],signingKey:[]});class Sa{txBuilder;protocolParams;meshTxBuilderBody=Ea();constructor(i){this.protocolParams=i||r_,this.txBuilder=pn(i)}serializeTxBody(i,t){t&&(this.protocolParams=t),this.txBuilder=pn(t);const{inputs:w,outputs:u,extraInputs:h,selectionThreshold:k,collaterals:j,referenceInputs:P,mints:p,changeAddress:V,certificates:G,validityRange:R,requiredSignatures:m,metadata:$}=i;if(h.length>0&&this.addUtxosFrom(h,String(k)),this.removeDuplicateInputs(),p.sort((W,v)=>W.policyId.localeCompare(v.policyId)),w.sort((W,v)=>W.txIn.txHash===v.txIn.txHash?W.txIn.txIndex-v.txIn.txIndex:W.txIn.txHash.localeCompare(v.txIn.txHash)),this.addAllInputs(w),this.addAllOutputs(u),this.addAllCollaterals(j),this.addAllReferenceInputs(P),this.addAllMints(p),this.addAllCertificates(G),this.addValidityRange(R),this.addAllRequiredSignatures(m),this.addAllMetadata($),this.addCostModels(),V){const W=j.map(ft=>{var a,Z;return((Z=(a=ft.txIn.amount)==null?void 0:a.find(g=>g.unit==="lovelace"))==null?void 0:Z.quantity)||"0"}).reduce((ft,a)=>ft+parseInt(a),0),v=Math.ceil(this.protocolParams.collateralPercent*Number(Number(this.txBuilder.min_fee().checked_add(y.exports.BigNum.from_str("10000")).to_js_value()))/100);let nt=!1;if(W-v>0){const ft=y.exports.TransactionOutput.new(y.exports.Address.from_bech32(V),y.exports.Value.new(y.exports.BigNum.from_str(String(v))));W-v>Number(y.exports.min_ada_for_output(ft,y.exports.DataCost.new_coins_per_byte(y.exports.BigNum.from_str(this.protocolParams.coinsPerUTxOSize))).to_js_value())&&(this.txBuilder.set_collateral_return(y.exports.TransactionOutput.new(y.exports.Address.from_bech32(V),y.exports.Value.new(y.exports.BigNum.from_str(String(W))))),this.txBuilder.set_total_collateral(y.exports.BigNum.from_str(String(W))),nt=!0)}this.addChange(V),nt&&this.addCollateralReturn(V)}return this.txBuilder.build_tx().to_hex()}addSigningKeys(i,t){return t.length>0?ps(i,t):i}addUtxosFrom=(i,t)=>{const w=this.meshTxBuilderBody.outputs.reduce((h,k)=>(k.amount.forEach(P=>{const{unit:p,quantity:V}=P,G=Number(h.get(p))||0;h.set(p,String(G+Number(V)))}),h),new Map);this.meshTxBuilderBody.inputs.reduce((h,k)=>{const j=k.txIn.amount;return j==null||j.forEach(P=>{const{unit:p,quantity:V}=P,G=Number(h.get(p))||0;h.set(p,String(G-Number(V)))}),h},w),this.meshTxBuilderBody.mints.reduce((h,k)=>{const j={unit:k.policyId+k.assetName,quantity:String(k.amount)},P=Number(h.get(j.unit))||0;return h.set(j.unit,String(P-Number(j.quantity))),h},w),ga(i,w,t).forEach(h=>{const k={type:"PubKey",txIn:{txHash:h.input.txHash,txIndex:h.input.outputIndex,amount:h.output.amount,address:h.output.address}};this.meshTxBuilderBody.inputs.push(k),this.addTxIn(k)})};makePlutusScriptSource=i=>{const t=y.exports.ScriptHash.from_hex(i.spendingScriptHash),w=y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(i.txHash),i.txIndex);return y.exports.PlutusScriptSource.new_ref_input_with_lang_ver(t,w,V_[i.version])};removeDuplicateInputs=()=>{const i=this.meshTxBuilderBody.inputs,t=u=>`${u.txHash}#${u.txIndex}`,w=[];for(let u=0;u<i.length;u++){const h=t(i[u].txIn);w.includes(h)?(i.splice(u,1),u--):w.push(h)}};addAllInputs=i=>{for(let t=0;t<i.length;t++){const w=i[t];switch(w.type){case"PubKey":this.addTxIn(w);break;case"Script":this.addScriptTxIn(w);break}}};addTxIn=i=>{this.txBuilder.add_input(y.exports.Address.from_bech32(i.txIn.address),y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(i.txIn.txHash),i.txIn.txIndex),Ee(i.txIn.amount))};addScriptTxIn=({scriptTxIn:i,txIn:t})=>{let w;const{datumSource:u,scriptSource:h,redeemer:k}=i;if(u.type==="Provided")w=y.exports.DatumSource.new(this.castDataToPlutusData(u.data));else{const p=y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(u.txHash),u.txIndex);w=y.exports.DatumSource.new_ref_input(p)}let j;h.type=="Inline"?j=this.makePlutusScriptSource(h.txInInfo):j=y.exports.PlutusScriptSource.new(y.exports.PlutusScript.from_hex_with_version(h.script.code,V_[h.script.version]));const P=y.exports.Redeemer.new(y.exports.RedeemerTag.new_spend(),y.exports.BigNum.from_str("0"),this.castDataToPlutusData(k.data),y.exports.ExUnits.new(y.exports.BigNum.from_str(String(k.exUnits.mem)),y.exports.BigNum.from_str(String(k.exUnits.steps))));this.txBuilder.add_plutus_script_input(y.exports.PlutusWitness.new_with_ref(j,w,P),y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(t.txHash),t.txIndex),Ee(t.amount))};addAllOutputs=i=>{for(let t=0;t<i.length;t++){const w=i[t];this.addOutput(w)}};addOutput=({amount:i,address:t,datum:w,referenceScript:u})=>{const h=Ee(i),k=h.multiasset();if(h.is_zero()&&k===void 0)throw Error("Invalid output amount");let j=y.exports.TransactionOutputBuilder.new().with_address(O_(t));w&&w.type==="Hash"&&(j=j.with_data_hash(y.exports.hash_plutus_data(this.castDataToPlutusData(w.data)))),w&&w.type==="Inline"&&(j=j.with_plutus_data(this.castDataToPlutusData(w.data))),u&&(j=j.with_script_ref(y.exports.ScriptRef.new_plutus_script(y.exports.PlutusScript.from_hex_with_version(u.code,V_[u.version]))));const P=j.next();if(k){const p=h.coin().is_zero()?P.with_asset_and_min_required_coin_by_utxo_cost(k,on(this.protocolParams.coinsPerUTxOSize)).build():P.with_coin_and_asset(h.coin(),k).build();this.txBuilder.add_output(p)}else{const p=P.with_coin(h.coin()).build();this.txBuilder.add_output(p)}};addAllCollaterals=i=>{const t=y.exports.TxInputsBuilder.new();for(let w=0;w<i.length;w++){const u=i[w];this.addCollateral(t,u)}this.txBuilder.set_collateral(t)};addCollateral=(i,t)=>{i.add_input(y.exports.Address.from_bech32(t.txIn.address),y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(t.txIn.txHash),t.txIn.txIndex),Ee(t.txIn.amount))};addCollateralReturn=i=>{var w;const t=(w=this.txBuilder.get_fee_if_set())==null?void 0:w.to_js_value();if(t){const u=Math.ceil(this.protocolParams.collateralPercent*Number(t)/100);this.txBuilder.set_total_collateral_and_return(y.exports.BigNum.from_str(String(u)),y.exports.Address.from_bech32(i))}};addAllReferenceInputs=i=>{i.forEach(t=>{this.addReferenceInput(t)})};addReferenceInput=({txHash:i,txIndex:t})=>{const w=y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(i),t);this.txBuilder.add_reference_input(w)};addAllMints=i=>{const t=y.exports.MintBuilder.new();let w=0;for(let u=0;u<i.length;u++){const h=i[u];if(!h.scriptSource)throw Error("Mint script is expected to be provided");if(h.type==="Plutus"){if(!h.redeemer)throw Error("Missing mint redeemer information");this.addPlutusMint(t,h,w),w++}else h.type==="Native"&&this.addNativeMint(t,h)}this.txBuilder.set_mint_builder(t)};addPlutusMint=(i,{redeemer:t,policyId:w,scriptSource:u,assetName:h,amount:k},j)=>{const P=y.exports.Redeemer.new(y.exports.RedeemerTag.new_mint(),y.exports.BigNum.from_str(String(j)),this.castDataToPlutusData(t.data),y.exports.ExUnits.new(y.exports.BigNum.from_str(String(t.exUnits.mem)),y.exports.BigNum.from_str(String(t.exUnits.steps)))),p=u.type==="Reference Script"?y.exports.PlutusScriptSource.new_ref_input_with_lang_ver(y.exports.ScriptHash.from_hex(w),y.exports.TransactionInput.new(y.exports.TransactionHash.from_hex(u.txHash),u.txIndex),V_[u.version]):y.exports.PlutusScriptSource.new(y.exports.PlutusScript.from_hex_with_version(u.script.code,V_[u.script.version]));i.add_asset(y.exports.MintWitness.new_plutus_script(p,P),y.exports.AssetName.new(Buffer.from(h,"hex")),y.exports.Int.from_str(k))};addNativeMint=(i,{scriptSource:t,assetName:w,amount:u})=>{if(t.type==="Reference Script")throw Error("Native mint cannot have reference script");i.add_asset(y.exports.MintWitness.new_native_script(y.exports.NativeScript.from_hex(t.script.code)),y.exports.AssetName.new(Buffer.from(w,"hex")),y.exports.Int.from_str(u))};decimalToFraction(i){const t=10**i.toString().split(".")[1].length;return[i*t,t]}toPoolParams=i=>{const t=this.decimalToFraction(i.margin),w=y.exports.Relays.new();i.relays.forEach(k=>{w.add(ya(k))});const u=y.exports.RewardAddress.from_address(y.exports.Address.from_bech32(i.rewardAddress));if(u===void 0)throw new Error("Reward address is invalid");const h=y.exports.Ed25519KeyHashes.new();return i.owners.forEach(k=>{h.add(y.exports.Ed25519KeyHash.from_hex(k))}),y.exports.PoolParams.new(y.exports.Ed25519KeyHash.from_hex(i.operator),y.exports.VRFKeyHash.from_hex(i.VRFKeyHash),y.exports.BigNum.from_str(i.pledge),y.exports.BigNum.from_str(i.cost),y.exports.UnitInterval.new(y.exports.BigNum.from_str(t[0].toString()),y.exports.BigNum.from_str(t[1].toString())),u,h,w,i.metadata?y.exports.PoolMetadata.from_json(_r.exports.stringify(i.metadata)):void 0)};addCertificate=(i,t)=>{switch(t.type){case"RegisterPool":i.add(y.exports.Certificate.new_pool_registration(y.exports.PoolRegistration.new(this.toPoolParams(t.poolParams))));break;case"RegisterStake":i.add(y.exports.Certificate.new_stake_registration(y.exports.StakeRegistration.new(y.exports.StakeCredential.from_keyhash(y.exports.Ed25519KeyHash.from_hex(t.stakeKeyHash)))));break;case"DelegateStake":i.add(y.exports.Certificate.new_stake_delegation(y.exports.StakeDelegation.new(y.exports.StakeCredential.from_keyhash(y.exports.Ed25519KeyHash.from_hex(t.stakeKeyHash)),t.poolId.startsWith("pool")?y.exports.Ed25519KeyHash.from_bech32(t.poolId):y.exports.Ed25519KeyHash.from_hex(t.poolId))));break;case"DeregisterStake":i.add(y.exports.Certificate.new_stake_deregistration(y.exports.StakeDeregistration.new(y.exports.StakeCredential.from_keyhash(y.exports.Ed25519KeyHash.from_hex(t.stakeKeyHash)))));break;case"RetirePool":i.add(y.exports.Certificate.new_pool_retirement(y.exports.PoolRetirement.new(t.poolId.startsWith("pool")?y.exports.Ed25519KeyHash.from_bech32(t.poolId):y.exports.Ed25519KeyHash.from_hex(t.poolId),t.epoch)))}};addAllCertificates=i=>{const t=y.exports.Certificates.new();i.forEach(w=>{this.addCertificate(t,w)}),this.txBuilder.set_certs(t)};addCostModels=()=>{this.txBuilder.calc_script_data_hash(y.exports.TxBuilderConstants.plutus_vasil_cost_models())};addChange=i=>{this.txBuilder.add_change_if_needed(y.exports.Address.from_bech32(i))};addValidityRange=({invalidBefore:i,invalidHereafter:t})=>{i&&this.txBuilder.set_validity_start_interval_bignum(y.exports.BigNum.from_str(i.toString())),t&&this.txBuilder.set_ttl_bignum(y.exports.BigNum.from_str(t.toString()))};addAllRequiredSignatures=i=>{i.forEach(t=>{this.txBuilder.add_required_signer(y.exports.Ed25519KeyHash.from_hex(t))})};addAllMetadata=i=>{i.forEach(({tag:t,metadata:w})=>{this.txBuilder.add_json_metadatum(y.exports.BigNum.from_str(t),_r.exports.stringify(w))})};castRawDataToJsonString=i=>typeof i=="object"?_r.exports.stringify(i):i;castDataToPlutusData=({type:i,content:t})=>i==="Mesh"?Le(t):i==="CBOR"?y.exports.PlutusData.from_hex(t):y.exports.PlutusData.from_json(t,y.exports.PlutusDatumSchema.DetailedSchema)}class Co{txHex="";txEvaluationMultiplier=1.1;_protocolParams=r_;serializer=new Sa(this._protocolParams);txOutput;addingScriptInput=!1;addingPlutusMint=!1;isHydra=!1;meshTxBuilderBody;mintItem;txInQueueItem;collateralQueueItem;refScriptTxInQueueItem;reset=()=>(this.txHex="",this.txEvaluationMultiplier=1.1,this._protocolParams=r_,this.txOutput=void 0,this.addingScriptInput=!1,this.addingPlutusMint=!1,this.mintItem=void 0,this.txInQueueItem=void 0,this.collateralQueueItem=void 0,this.refScriptTxInQueueItem=void 0,this.meshTxBuilderBody=this.emptyTxBuilderBody(),this);emptyTxBuilderBody=()=>({inputs:[],outputs:[],extraInputs:[],selectionThreshold:0,collaterals:[],requiredSignatures:[],referenceInputs:[],mints:[],changeAddress:"",metadata:[],validityRange:{},certificates:[],signingKey:[]});constructor(i){this.meshTxBuilderBody=this.emptyTxBuilderBody(),i&&(this.serializer=i)}completeSync=i=>{i?this.meshTxBuilderBody=i:this.queueAllLastItem();let t=r_;return this.isHydra&&(t={...t,minFeeA:0,minFeeB:0,priceMem:0,priceStep:0,collateralPercent:0,coinsPerUTxOSize:"0"}),this.serializer.serializeTxBody(this.meshTxBuilderBody,t)};completeSigning=()=>{const{signingKey:i}=this.meshTxBuilderBody;return this.txHex=this.serializer.addSigningKeys(this.txHex,i),this.txHex};txIn=(i,t,w,u)=>(this.txInQueueItem&&this.queueInput(),this.addingScriptInput?this.txInQueueItem={type:"Script",txIn:{txHash:i,txIndex:t,amount:w,address:u},scriptTxIn:{}}:this.txInQueueItem={type:"PubKey",txIn:{txHash:i,txIndex:t,amount:w,address:u}},this.addingScriptInput=!1,this);txInScript=(i,t="V2")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Datum value attempted to be called a non script input");return this.txInQueueItem.scriptTxIn.scriptSource={type:"Provided",script:{code:i,version:t}},this};txInDatumValue=(i,t="Mesh")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Datum value attempted to be called a non script input");let w=i;return t==="JSON"&&(w=this.castRawDataToJsonString(i)),t==="Mesh"?(this.txInQueueItem.scriptTxIn.datumSource={type:"Provided",data:{type:t,content:i}},this):(this.txInQueueItem.scriptTxIn.datumSource={type:"Provided",data:{type:t,content:w}},this)};txInInlineDatumPresent=()=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Inline datum present attempted to be called a non script input");const{txHash:i,txIndex:t}=this.txInQueueItem.txIn;return i&&t.toString()&&(this.txInQueueItem.scriptTxIn.datumSource={type:"Inline",txHash:i,txIndex:t}),this};txInRedeemerValue=(i,t={...Ze},w="Mesh")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Spending tx in reference redeemer attempted to be called a non script input");let u=i;return w==="Mesh"?(this.txInQueueItem.scriptTxIn.redeemer={data:{type:w,content:i},exUnits:t},this):(w==="JSON"&&(u=this.castRawDataToJsonString(i)),this.txInQueueItem.scriptTxIn.redeemer={data:{type:w,content:u},exUnits:t},this)};txOut=(i,t)=>(this.txOutput&&(this.meshTxBuilderBody.outputs.push(this.txOutput),this.txOutput=void 0),this.txOutput={address:i,amount:t},this);txOutDatumHashValue=(i,t="Mesh")=>{let w=i;if(this.txOutput){if(t==="Mesh")return this.txOutput.datum={type:"Hash",data:{type:t,content:w}},this;t==="JSON"&&(w=this.castRawDataToJsonString(i)),this.txOutput.datum={type:"Hash",data:{type:t,content:w}}}return this};txOutInlineDatumValue=(i,t="Mesh")=>{let w=i;if(this.txOutput){if(t==="Mesh")return this.txOutput.datum={type:"Inline",data:{type:t,content:w}},this;t==="JSON"&&(w=this.castRawDataToJsonString(i)),this.txOutput.datum={type:"Inline",data:{type:t,content:w}}}return this};txOutReferenceScript=(i,t="V2")=>(this.txOutput&&(this.txOutput.referenceScript={code:i,version:t}),this);spendingPlutusScriptV2=()=>(this.addingScriptInput=!0,this);spendingTxInReference=(i,t,w,u="V2")=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="PubKey")throw Error("Spending tx in reference attempted to be called a non script input");return this.txInQueueItem.scriptTxIn.scriptSource={type:"Inline",txInInfo:{txHash:i,txIndex:t,spendingScriptHash:w,version:u}},this};spendingReferenceTxInInlineDatumPresent=()=>(this.txInInlineDatumPresent(),this);spendingReferenceTxInRedeemerValue=(i,t={...Ze},w="Mesh")=>(this.txInRedeemerValue(i,t,w),this);readOnlyTxInReference=(i,t)=>(this.meshTxBuilderBody.referenceInputs.push({txHash:i,txIndex:t}),this);mintPlutusScriptV2=()=>(this.addingPlutusMint=!0,this);mint=(i,t,w)=>(this.mintItem&&this.queueMint(),this.mintItem={type:this.addingPlutusMint?"Plutus":"Native",policyId:t,assetName:w,amount:i},this.addingPlutusMint=!1,this);mintingScript=(i,t="V2")=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.type)throw Error("Mint information missing");return this.mintItem.scriptSource={type:"Provided",script:{code:i,version:t}},this};mintTxInReference=(i,t,w="V2")=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.type)throw Error("Mint information missing");if(this.mintItem.type=="Native")throw Error("Mint tx in reference can only be used on plutus script tokens");if(!this.mintItem.policyId)throw Error("PolicyId information missing from mint asset");return this.mintItem.scriptSource={type:"Reference Script",txHash:i,txIndex:t,version:w},this};mintReferenceTxInRedeemerValue=(i,t={...Ze},w="Mesh")=>{if(!this.mintItem)throw Error("Undefined mint");if(this.mintItem.type=="Native")throw Error("Mint tx in reference can only be used on plutus script tokens");if(this.mintItem.type=="Plutus"){if(!this.mintItem.policyId)throw Error("PolicyId information missing from mint asset");let u=i;if(w==="Mesh")return this.mintItem.redeemer={data:{type:w,content:u},exUnits:t},this;w==="JSON"&&(u=this.castRawDataToJsonString(i)),this.mintItem.redeemer={data:{type:w,content:u},exUnits:t}}return this};mintRedeemerValue=(i,t={...Ze},w="Mesh")=>(this.mintReferenceTxInRedeemerValue(i,t,w),this);requiredSignerHash=i=>(this.meshTxBuilderBody.requiredSignatures.push(i),this);txInCollateral=(i,t,w,u)=>(this.collateralQueueItem&&this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem),this.collateralQueueItem={type:"PubKey",txIn:{txHash:i,txIndex:t,amount:w,address:u}},this);registerPoolCertificate=i=>(this.meshTxBuilderBody.certificates.push({type:"RegisterPool",poolParams:i}),this);registerStakeCertificate=i=>(this.meshTxBuilderBody.certificates.push({type:"RegisterStake",stakeKeyHash:i}),this);delegateStakeCertificate=(i,t)=>(this.meshTxBuilderBody.certificates.push({type:"DelegateStake",stakeKeyHash:i,poolId:t}),this);deregisterStakeCertificate=i=>(this.meshTxBuilderBody.certificates.push({type:"DeregisterStake",stakeKeyHash:i}),this);retirePoolCertificate=(i,t)=>(this.meshTxBuilderBody.certificates.push({type:"RetirePool",poolId:i,epoch:t}),this);changeAddress=i=>(this.meshTxBuilderBody.changeAddress=i,this);invalidBefore=i=>(this.meshTxBuilderBody.validityRange.invalidBefore=i,this);invalidHereafter=i=>(this.meshTxBuilderBody.validityRange.invalidHereafter=i,this);metadataValue=(i,t)=>(this.meshTxBuilderBody.metadata.push({tag:i,metadata:t}),this);protocolParams=i=>{const t={...r_,...i};return this._protocolParams=t,this};signingKey=i=>(this.meshTxBuilderBody.signingKey.push(i),this);selectUtxosFrom=(i,t=5e6)=>(this.meshTxBuilderBody.extraInputs=i,this.meshTxBuilderBody.selectionThreshold=t,this);queueInput=()=>{if(!this.txInQueueItem)throw Error("Undefined input");if(this.txInQueueItem.type==="Script")if(this.txInQueueItem.scriptTxIn){if(!this.txInQueueItem.scriptTxIn.datumSource)throw Error("Script input does not contain datum information");if(!this.txInQueueItem.scriptTxIn.redeemer)throw Error("Script input does not contain redeemer information");if(!this.txInQueueItem.scriptTxIn.scriptSource)throw Error("Script input does not contain script information")}else throw Error("Script input does not contain script, datum, or redeemer information");this.meshTxBuilderBody.inputs.push(this.txInQueueItem),this.txInQueueItem=void 0};queueMint=()=>{if(!this.mintItem)throw Error("Undefined mint");if(!this.mintItem.scriptSource)throw Error("Missing mint script information");this.meshTxBuilderBody.mints.push(this.mintItem),this.mintItem=void 0};removeDuplicateInputs=()=>{const i=this.meshTxBuilderBody.inputs,t=u=>`${u.txHash}#${u.txIndex}`,w=[];for(let u=0;u<i.length;u++){const h=t(i[u].txIn);w.includes(h)?(i.splice(u,1),u--):w.push(h)}};queueAllLastItem=()=>{this.txOutput&&(this.meshTxBuilderBody.outputs.push(this.txOutput),this.txOutput=void 0),this.txInQueueItem&&this.queueInput(),this.collateralQueueItem&&(this.meshTxBuilderBody.collaterals.push(this.collateralQueueItem),this.collateralQueueItem=void 0),this.mintItem&&this.queueMint()};updateRedeemer=(i,t)=>{t.forEach(w=>{switch(w.tag){case"SPEND":{const u=i.inputs[w.index];u.type=="Script"&&u.scriptTxIn.redeemer&&(u.scriptTxIn.redeemer.exUnits.mem=Math.floor(w.budget.mem*this.txEvaluationMultiplier),u.scriptTxIn.redeemer.exUnits.steps=Math.floor(w.budget.steps*this.txEvaluationMultiplier));break}case"MINT":{const u=i.mints[w.index];u.type=="Plutus"&&u.redeemer&&(u.redeemer.exUnits.mem=Math.floor(w.budget.mem*this.txEvaluationMultiplier),u.redeemer.exUnits.steps=Math.floor(w.budget.steps*this.txEvaluationMultiplier));break}}})};castRawDataToJsonString=i=>typeof i=="object"?_r.exports.stringify(i):i}class jo extends Co{_fetcher;_submitter;_evaluator;queriedTxHashes=new Set;queriedUTxOs={};constructor({fetcher:i,submitter:t,evaluator:w,isHydra:u=!1}){super(),i&&(this._fetcher=i),t&&(this._submitter=t),w&&(this._evaluator=w),u&&(this.isHydra=!0)}complete=async i=>{i?this.meshTxBuilderBody=i:this.queueAllLastItem();const{inputs:t,collaterals:w}=this.meshTxBuilderBody,u=[...t,...w].filter(h=>!this.isInputComplete(h));if(await this.queryAllTxInfo(u),u.forEach(h=>{this.completeTxInformation(h)}),this.completeSync(i),this._evaluator){const h=await this._evaluator.evaluateTx(this.txHex);this.updateRedeemer(this.meshTxBuilderBody,h),this.completeSync(i)}return this};submitTx=async i=>{var w;return await((w=this._submitter)==null?void 0:w.submitTx(i))};getUTxOInfo=async i=>{var w;let t=[];this.queriedTxHashes.has(i)||(this.queriedTxHashes.add(i),t=await((w=this._fetcher)==null?void 0:w.fetchUTxOs(i))||[],this.queriedUTxOs[i]=t)};queryAllTxInfo=i=>{var w;const t=[];if(i.length>0&&!this._fetcher)throw Error("Transaction information is incomplete while no fetcher instance is provided");for(let u=0;u<i.length;u++){const h=i[u];this.isInputInfoComplete(h)||t.push(this.getUTxOInfo(h.txIn.txHash)),h.type==="Script"&&((w=h.scriptTxIn.scriptSource)==null?void 0:w.type)==="Inline"&&!this.isRefScriptInfoComplete(h)&&t.push(this.getUTxOInfo(h.scriptTxIn.scriptSource.txInInfo.txHash))}return Promise.all(t)};completeTxInformation=i=>{var t;if(!this.isInputInfoComplete(i)){const w=this.queriedUTxOs[i.txIn.txHash],u=w==null?void 0:w.find(j=>j.input.outputIndex===i.txIn.txIndex),h=u==null?void 0:u.output.amount,k=u==null?void 0:u.output.address;if(!h||h.length===0)throw Error(`Couldn't find value information for ${i.txIn.txHash}#${i.txIn.txIndex}`);if(i.txIn.amount=h,i.type==="PubKey"){if(!k||k==="")throw Error(`Couldn't find address information for ${i.txIn.txHash}#${i.txIn.txIndex}`);i.txIn.address=k}}if(i.type==="Script"&&((t=i.scriptTxIn.scriptSource)==null?void 0:t.type)=="Inline"&&!this.isRefScriptInfoComplete(i)){const w=i.scriptTxIn.scriptSource.txInInfo,h=this.queriedUTxOs[w.txHash].find(k=>k.input.outputIndex===w.txIndex);if(!h)throw Error(`Couldn't find script reference utxo for ${w.txHash}#${w.txIndex}`);w.spendingScriptHash=h==null?void 0:h.output.scriptHash}};isInputComplete=i=>i.type==="PubKey"?this.isInputInfoComplete(i):i.type==="Script"?this.isInputInfoComplete(i)&&this.isRefScriptInfoComplete(i):!0;isInputInfoComplete=i=>{const{amount:t,address:w}=i.txIn;return!(i.type==="PubKey"&&(!t||!w)||i.type==="Script"&&!t)};isRefScriptInfoComplete=i=>{var w;const{scriptSource:t}=i.scriptTxIn;return!((t==null?void 0:t.type)==="Inline"&&!((w=t.txInInfo)!=null&&w.spendingScriptHash))}}const Gr=(c,i)=>{const t=c.vkeys();if(t!==void 0){const w=new Set;for(let h=0;h<t.len();h+=1)w.add(t.get(h).to_hex());for(let h=0;h<i.len();h+=1)w.add(i.get(h).to_hex());const u=y.exports.Vkeywitnesses.new();return w.forEach(h=>{u.add(y.exports.Vkeywitness.from_hex(h))}),u}return i};class Vt{_networkId;_encryptedSecret;constructor(i,t){this._networkId=i,this._encryptedSecret=t}getAccount(i,t){return this.accountContext(i,t,(w,u)=>{const h=zn(this._networkId,w.to_public().hash(),u.to_public().hash()).to_address().to_bech32(),k=Vn(this._networkId,w.to_public().hash()).to_address().to_bech32(),j=dn(this._networkId,u.to_public().hash()).to_address().to_bech32();return{baseAddress:h,enterpriseAddress:k,rewardAddress:j}})}signData(i,t,w,u){try{return this.accountContext(i,t,(h,k)=>{const j={payload:u},P={address:Vt.resolveAddress(this._networkId,w,h,k),key:w.startsWith("stake")?k:h},{coseSign1:p,coseKey:V}=hs(j,P);return{signature:p,key:V}})}catch(h){throw new Error(`An error occurred during signData: ${h}.`)}}signTx(i,t,w,u,h){try{const k=ba(Aa(u));return this.accountContext(i,t,(j,P)=>{const p=y.exports.Vkeywitnesses.new();return Vt.resolveSigners(u,w,j.to_public().hash().to_hex()).forEach(G=>{if(G===j.to_public().hash().to_hex())p.add(y.exports.make_vkey_witness(k,j));else if(G===P.to_public().hash().to_hex())p.add(y.exports.make_vkey_witness(k,P));else if(h===!1)throw new Error(`Missing key witness for: ${G}`)}),p})}catch(k){throw new Error(`An error occurred during signTx: ${k}.`)}}static encryptMnemonic(i,t){const w=tn.mnemonicToEntropy(i.join(" ")),u=ka(w),h=c_(u.as_bytes());return u.free(),Vt.encrypt(h,t)}static encryptPrivateKey(i,t){const w=y.exports.Bip32PrivateKey.from_bech32(i),u=c_(w.as_bytes());return w.free(),Vt.encrypt(u,t)}static encryptSigningKeys(i,t,w){const u=Vt.encrypt(i.slice(4),w),h=Vt.encrypt(t.slice(4),w);return[u,h]}static generateMnemonic(i=256){return tn.generateMnemonic(i).split(" ")}accountContext(i,t,w){const{paymentKey:u,stakeKey:h}=Vt.resolveKeys(i,t,this._encryptedSecret),k=w(u,h);return u.free(),h.free(),k}static decrypt(i,t){try{return y.exports.decrypt_with_password(p_(t),i)}catch{throw new Error("The password is incorrect.")}}static encrypt(i,t){const w=$n.customAlphabet("0123456789abcdef"),u=w(64),h=w(24);return y.exports.encrypt_with_password(p_(t),u,h,i)}static resolveAddress(i,t,w,u){const h=[zn(i,w.to_public().hash(),u.to_public().hash()),Vn(i,w.to_public().hash()),dn(i,u.to_public().hash())].find(k=>k.to_address().to_bech32()===t);if(h!==void 0)return h.to_address();throw new Error(`Address: ${t} doesn't belong to this account.`)}static resolveKeys(i,t,w){if(typeof w=="string"){const k=Vt.decrypt(w,t);return Rs(k,i)}const u=Vt.decrypt(w[0],t),h=Vt.decrypt(w[1],t);return{paymentKey:y.exports.PrivateKey.from_hex(u),stakeKey:y.exports.PrivateKey.from_hex(h)}}static resolveSigners(i,t,w){const u=j=>{const P=(W,v=[],nt=0)=>{var Z,g,D,Q,J;if(W===void 0||nt>=W.len())return v;const ft=W.get(nt),a=new Array;switch(ft.kind()){case y.exports.CertificateKind.StakeDeregistration:{const ct=(Z=ft.as_stake_deregistration())==null?void 0:Z.stake_credential(),ut=(ct==null?void 0:ct.kind())===y.exports.StakeCredKind.Key?ct.to_keyhash():void 0;ut&&a.push(ut.to_hex());break}case y.exports.CertificateKind.StakeDelegation:{const ct=(g=ft.as_stake_delegation())==null?void 0:g.stake_credential(),ut=(ct==null?void 0:ct.kind())===y.exports.StakeCredKind.Key?ct.to_keyhash():void 0;ut&&a.push(ut.to_hex());break}case y.exports.CertificateKind.PoolRegistration:{const ct=(D=ft.as_pool_registration())==null?void 0:D.pool_params().pool_owners();a.push(...V(ct));break}case y.exports.CertificateKind.PoolRetirement:{const ct=(Q=ft.as_pool_retirement())==null?void 0:Q.pool_keyhash();ct&&a.push(ct.to_hex());break}case y.exports.CertificateKind.MoveInstantaneousRewardsCert:{const ct=(J=ft.as_move_instantaneous_rewards_cert())==null?void 0:J.move_instantaneous_reward().as_to_stake_creds();if(ct)for(let ut=0;ut<ct.len();ut+=1){const xt=ct.keys().get(ut),At=xt.kind()===y.exports.StakeCredKind.Key?xt.to_keyhash():void 0;At&&a.push(At.to_hex())}break}}return P(W,[...v,...a],nt+1)},p=(W,v=[],nt=0)=>{if(W===void 0||nt>=W.len())return v;const ft=W.get(nt).index(),a=W.get(nt).transaction_id(),Z=t.find(g=>g.input.outputIndex===ft&&g.input.txHash===a.to_hex())!==void 0?w:"OUR_PRINCESS_IS_IN_ANOTHER_CASTLE";return p(W,[...v,Z],nt+1)},V=(W,v=[],nt=0)=>W===void 0||nt>=W.len()?v:V(W,[...v,W.get(nt).to_hex()],nt+1),G=(W,v=[],nt=0)=>{if(W===void 0||nt>=W.len())return v;const ft=W.keys().get(nt).payment_cred(),a=ft.kind()===y.exports.StakeCredKind.Key?ft.to_keyhash():void 0;return G(W,a?[...v,a.to_hex()]:v,nt+1)},R=j.certs(),m=j.collateral(),$=j.inputs(),b=j.required_signers(),_t=j.withdrawals();return[...P(R),...p(m),...p($),...V(b),...G(_t)]},h=j=>{const P=(V,G=[])=>{var R,m,$,b;if(V)for(let _t=0;_t<V.len();_t+=1){const W=V.get(_t);switch(W.kind()){case y.exports.NativeScriptKind.ScriptPubkey:{const v=(R=W.as_script_pubkey())==null?void 0:R.addr_keyhash().to_hex();return v?[...G,v]:G}case y.exports.NativeScriptKind.ScriptAll:return P((m=W.as_script_all())==null?void 0:m.native_scripts(),G);case y.exports.NativeScriptKind.ScriptAny:return P(($=W.as_script_any())==null?void 0:$.native_scripts(),G);case y.exports.NativeScriptKind.ScriptNOfK:return P((b=W.as_script_n_of_k())==null?void 0:b.native_scripts(),G)}}return G},p=j.native_scripts();return[...P(p)]},k=Y_(i);return new Set([...u(k.body()),...h(k.witness_set())])}}const S_="MARI0TIME";class Lr{_fetcher;_submitter;_wallet;constructor(i){switch(this._fetcher=i.fetcher,this._submitter=i.submitter,i.key.type){case"mnemonic":this._wallet=new Vt(i.networkId,Vt.encryptMnemonic(i.key.words,S_));break;case"root":this._wallet=new Vt(i.networkId,Vt.encryptPrivateKey(i.key.bech32,S_));break;case"cli":this._wallet=new Vt(i.networkId,Vt.encryptSigningKeys(i.key.payment,i.key.stake??"f0".repeat(34),S_))}}getBaseAddress(i=0){return this._wallet.getAccount(i,S_).baseAddress}getPaymentAddress(i=0){return this._wallet.getAccount(i,S_).enterpriseAddress}getRewardAddress(i=0){return this._wallet.getAccount(i,S_).rewardAddress}getUsedAddress(i=0){const t=this._wallet.getAccount(i,S_);return O_(t.enterpriseAddress)}getUsedCollateral(i=r_.maxCollateralInputs){throw new Error("getUsedCollateral not implemented.")}async getUsedUTxOs(i=0){const t=this._wallet.getAccount(i,S_);return(await this._fetcher.fetchAddressUTxOs(t.enterpriseAddress)).map(u=>Q_(u))}signData(i,t,w=0){try{return this._wallet.signData(w,S_,i,t)}catch(u){throw new Error(`[AppWallet] An error occurred during signData: ${u}.`)}}async signTx(i,t=!1,w=0){try{const u=this._wallet.getAccount(w,S_),h=await this._fetcher.fetchAddressUTxOs(u.enterpriseAddress),k=this._wallet.signTx(w,S_,h,i,t),j=Y_(i),P=j.witness_set(),p=Gr(P,k);return P.set_vkeys(p),y.exports.Transaction.new(j.body(),P,j.auxiliary_data()).to_hex()}catch(u){throw new Error(`[AppWallet] An error occurred during signTx: ${u}.`)}}async signTxs(i,t){return console.log("unimplemented",i,t),[]}submitTx(i){return this._submitter.submitTx(i)}static brew(i=256){return Vt.generateMnemonic(i)}async getUtxos(){return await this.getUsedUTxOs()}async getCollateral(){return(await this.getUsedUTxOs())[0]}async getUsedAddresses(){return console.log(1,await this.getPaymentAddress()),[await this.getPaymentAddress()]}}class Yr{_walletInstance;_walletName;walletInstance;constructor(i,t){this._walletInstance=i,this._walletName=t,this.walletInstance={...i}}static getInstalledWallets(){return window.cardano===void 0?[]:an.filter(i=>window.cardano[i]!==void 0).map(i=>({name:window.cardano[i].name,icon:window.cardano[i].icon,version:window.cardano[i].apiVersion}))}static async enable(i){try{const t=await Yr.resolveInstance(i);if(t!==void 0)return new Yr(t,i);throw new Error(`Couldn't create an instance of wallet: ${i}`)}catch(t){throw new Error(`[BrowserWallet] An error occurred during enable: ${JSON.stringify(t)}.`)}}async getBalance(){const i=await this._walletInstance.getBalance();return ma(Ws(i))}async getChangeAddress(){const i=await this._walletInstance.getChangeAddress();return cr(i).to_bech32()}async getCollateral(i=r_.maxCollateralInputs){return(await this.getUsedCollateral(i)).map(w=>jr(w))}getNetworkId(){return this._walletInstance.getNetworkId()}async getRewardAddresses(){return(await this._walletInstance.getRewardAddresses()).map(t=>cr(t).to_bech32())}async getUnusedAddresses(){return(await this._walletInstance.getUnusedAddresses()).map(t=>cr(t).to_bech32())}async getUsedAddresses(){return(await this._walletInstance.getUsedAddresses()).map(t=>cr(t).to_bech32())}async getUtxos(i=void 0){return(await this.getUsedUTxOs(i)).map(w=>jr(w))}signData(i,t){const w=O_(i).to_hex();return this._walletInstance.signData(w,p_(t))}async signTx(i,t=!1){try{const w=Y_(i),u=w.witness_set(),h=await this._walletInstance.signTx(i,t),k=Rn(h).vkeys()??y.exports.Vkeywitnesses.new(),j=Gr(u,k);return u.set_vkeys(j),c_(y.exports.Transaction.new(w.body(),u,w.auxiliary_data()).to_bytes())}catch(w){throw new Error(`[BrowserWallet] An error occurred during signTx: ${JSON.stringify(w)}.`)}}async signTxs(i,t=!1){let w;switch(this._walletName){case"Typhon Wallet":this._walletInstance.signTxs&&(w=await this._walletInstance.signTxs(i,t));break;default:this._walletInstance.signTxs?w=await this._walletInstance.signTxs(i.map(h=>({cbor:h,partialSign:t}))):this._walletInstance.experimental.signTxs&&(w=await this._walletInstance.experimental.signTxs(i.map(h=>({cbor:h,partialSign:t}))));break}if(!w)throw new Error("Wallet does not support signTxs");const u=[];for(let h=0;h<w.length;h++){const k=Y_(i[h]),j=k.witness_set(),P=Rn(w[h]).vkeys()??y.exports.Vkeywitnesses.new(),p=Gr(j,P);j.set_vkeys(p);const V=c_(y.exports.Transaction.new(k.body(),j,k.auxiliary_data()).to_bytes());u.push(V)}return u}submitTx(i){return this._walletInstance.submitTx(i)}async getUsedAddress(){const i=await this._walletInstance.getUsedAddresses();return cr(i[0])}async getUsedCollateral(i=r_.maxCollateralInputs){return(await this._walletInstance.experimental.getCollateral()??[]).map(w=>qn(w)).slice(0,i)}async getUsedUTxOs(i=void 0){const t=i?Ee(i).to_hex():void 0;return(await this._walletInstance.getUtxos(t)??[]).map(u=>qn(u))}async getAssets(){return(await this.getBalance()).filter(t=>t.unit!=="lovelace").map(t=>{const w=t.unit.slice(0,s_),u=t.unit.slice(s_),h=An(w,u);return{unit:t.unit,policyId:w,assetName:xn(u),fingerprint:h,quantity:t.quantity}})}async getLovelace(){const t=(await this.getBalance()).find(w=>w.unit==="lovelace");return t!==void 0?t.quantity:"0"}async getPolicyIdAssets(i){return(await this.getAssets()).filter(w=>w.policyId===i)}async getPolicyIds(){const i=await this.getBalance();return Array.from(new Set(i.map(t=>t.unit.slice(0,s_)))).filter(t=>t!=="lovelace")}static resolveInstance(i){if(window.cardano===void 0)return;const t=an.map(w=>window.cardano[w]).filter(w=>w!==void 0).find(w=>w.name.toLowerCase()===i.toLowerCase());return t==null?void 0:t.enable()}}class Bo{_wallet;_network;constructor(i){switch(this._network=i.networkId,i.key.type){case"root":this._wallet=new Lr({networkId:i.networkId,fetcher:i.fetcher,submitter:i.submitter,key:{type:"root",bech32:i.key.bech32}});break;case"cli":this._wallet=new Lr({networkId:i.networkId,fetcher:i.fetcher,submitter:i.submitter,key:{type:"cli",payment:i.key.payment}});break;case"mnemonic":this._wallet=new Lr({networkId:i.networkId,fetcher:i.fetcher,submitter:i.submitter,key:{type:"mnemonic",words:i.key.words}});break}}async getBalance(){const i=await this.getUtxos(),t=new Map;return i.map(u=>{u.output.amount.map(h=>{const k=h.unit,j=Number(h.quantity);if(t.has(k)){const P=t.get(k);t.set(k,P+j)}else t.set(k,j)})}),Array.from(t,([u,h])=>({unit:u,quantity:h.toString()}))}getChangeAddress(){return this._wallet.getPaymentAddress()}async getCollateral(){const t=(await this.getUtxos()).filter(w=>w.output.amount.length===1&&w.output.amount[0].unit==="lovelace");t.sort((w,u)=>Number(w.output.amount[0].quantity)-Number(u.output.amount[0].quantity));for(const w of t)if(Number(w.output.amount[0].quantity)>=5e6)return[w];return[]}getNetworkId(){return this._network}async getRewardAddresses(){return[await this._wallet.getRewardAddress()]}getUnusedAddresses(){return[this.getChangeAddress()]}async getUsedAddresses(){return[this.getChangeAddress()]}async getUtxos(){return(await this.getUsedUTxOs()).map(t=>jr(t))}signData(i){return this._wallet.signData(this.getChangeAddress(),i)}async signTx(i,t=!1){return await this._wallet.signTx(i,t)}async signTxs(i,t=!1){const w=[];for(const u of i){const h=await this.signTx(u,t);w.push(h)}return w}async submitTx(i){return await this._wallet.submitTx(i)}getUsedAddress(){return this._wallet.getUsedAddress()}async getUsedCollateral(){return(await this.getCollateral()).map(w=>Q_(w))}async getUsedUTxOs(){return await this._wallet.getUtxos()}async getAssets(){return(await this.getBalance()).filter(t=>t.unit!=="lovelace").map(t=>{const w=t.unit.slice(0,s_),u=t.unit.slice(s_),h=An(w,u);return{unit:t.unit,policyId:w,assetName:xn(u),fingerprint:h,quantity:t.quantity}})}async getLovelace(){const t=(await this.getBalance()).find(w=>w.unit==="lovelace");return t!==void 0?t.quantity:"0"}async getPolicyIdAssets(i){return(await this.getAssets()).filter(w=>w.policyId===i)}async getPolicyIds(){const i=await this.getBalance();return Array.from(new Set(i.map(t=>t.unit.slice(0,s_)))).filter(t=>t!=="lovelace")}async createCollateral(){const t=await new exports.Transaction({initiator:this._wallet}).sendLovelace(this.getChangeAddress(),"5000000").build(),w=await this.signTx(t);return await this.submitTx(w)}static brew(i=!1,t=256){const w=Vt.generateMnemonic(t);return i?xa(w):w}}exports.AppWallet=Lr;exports.BlockfrostProvider=wo;exports.BrowserWallet=Yr;exports.CSLSerializer=Sa;exports.DEFAULT_PROTOCOL_PARAMETERS=r_;exports.DEFAULT_REDEEMER_BUDGET=Ze;exports.EmbeddedWallet=Vt;exports.ForgeScript=vo;exports.HARDENED_KEY_START=Hr;exports.InfuraProvider=lo;exports.KoiosProvider=go;exports.LANGUAGE_VERSIONS=V_;exports.MaestroProvider=ho;exports.MeshTxBuilder=jo;exports.MeshWallet=Bo;exports.OgmiosProvider=fo;exports.POLICY_ID_LENGTH=s_;exports.REDEEMER_TAGS=Xn;exports.SUPPORTED_CLOCKS=Ar;exports.SUPPORTED_COST_MODELS=nn;exports.SUPPORTED_HANDLES=Wr;exports.SUPPORTED_LANGUAGE_VIEWS=Zn;exports.SUPPORTED_OGMIOS_LINKS=ta;exports.SUPPORTED_TOKENS=_a;exports.SUPPORTED_WALLETS=an;exports.YaciProvider=yo;exports.assetClass=Xa;exports.assocMap=_n;exports.bool=Ya;exports.builtinByteString=Oe;exports.checkSignature=ys;exports.conStr=$r;exports.conStr0=m_;exports.conStr1=Jr;exports.conStr2=Ga;exports.currencySymbol=gn;exports.dict=rs;exports.emptyTxBuilderBody=Ea;exports.generateNonce=co;exports.integer=ln;exports.isNetwork=Ia;exports.keepRelevant=ea;exports.largestFirst=ws;exports.largestFirstMultiAsset=ra;exports.list=$a;exports.mConStr=Ra;exports.mConStr0=wr;exports.mConStr1=Jn;exports.mConStr2=La;exports.mMaybeStakingHash=wn;exports.mPubKeyAddress=za;exports.mScriptAddress=Va;exports.maybeStakingHash=bn;exports.mergeAssets=uo;exports.mergeSignatures=Gr;exports.parseAssetUnit=Qe;exports.parseHttpError=Y;exports.parsePlutusValueToAssets=ss;exports.paymentPubKeyHash=ts;exports.posixTime=es;exports.pubKeyAddress=Ja;exports.pubKeyHash=_s;exports.readPlutusData=po;exports.resolveDataHash=to;exports.resolveEpochNo=_o;exports.resolveFingerprint=An;exports.resolveLanguageView=eo;exports.resolveNativeScriptHash=ro;exports.resolvePaymentKeyHash=tr;exports.resolvePlutusScriptAddress=no;exports.resolvePlutusScriptHash=ao;exports.resolvePoolId=so;exports.resolvePrivateKey=xa;exports.resolveRewardAddress=Br;exports.resolveScriptRef=oo;exports.resolveSlotNo=io;exports.resolveStakeKeyHash=pr;exports.resolveTxFees=In;exports.resolveTxHash=Aa;exports.scriptAddress=Wa;exports.selectUtxos=ga;exports.tokenName=un;exports.tuple=ns;exports.txOutRef=Za;exports.value=as;
|