@harmoniclabs/plu-ts-offchain
Advanced tools
Comparing version 0.1.15 to 0.1.16-dev0
import { GenesisInfos, NormalizedGenesisInfos } from "./GenesisInfos.js"; | ||
import { CostModelsToLanguageViewCborOpts } from "@harmoniclabs/cardano-costmodels-ts"; | ||
import { Tx, Value, ValueUnits, TxOut, TxRedeemerTag, ScriptType, UTxO, TxRedeemer, TxWitnessSet, ScriptDataHash, ITxOut } from "@harmoniclabs/cardano-ledger-ts"; | ||
@@ -55,3 +56,3 @@ import { CborString, CanBeCborString } from "@harmoniclabs/cbor"; | ||
*/ | ||
overrideTxRedeemers(tx: Tx, newRedeemers: TxRedeemer[]): Tx; | ||
overrideTxRedeemers(tx: Tx, newRedeemers: TxRedeemer[], opts?: CostModelsToLanguageViewCborOpts): Tx; | ||
buildSync(buildArgs: ITxBuildArgs, { onScriptInvalid, onScriptResult }?: ITxBuildSyncOptions): Tx; | ||
@@ -58,0 +59,0 @@ assertMinOutLovelaces(txOuts: TxOut[]): void; |
@@ -118,2 +118,3 @@ "use strict"; | ||
var Rational_1 = require("../utils/Rational.js"); | ||
var stringify_1 = require("../utils/stringify.js"); | ||
// const scriptCache: { [x: string]: UPLCTerm } = {}; | ||
@@ -280,7 +281,8 @@ function getScriptLikeUplc(scriptLike) { | ||
*/ | ||
TxBuilder.prototype.overrideTxRedeemers = function (tx, newRedeemers) { | ||
TxBuilder.prototype.overrideTxRedeemers = function (tx, newRedeemers, opts) { | ||
var _a; | ||
if (opts === void 0) { opts = { mustHaveV3: true }; } | ||
// datums passed by hash | ||
var datums = (_a = tx.witnesses.datums) !== null && _a !== void 0 ? _a : []; | ||
return new cardano_ledger_ts_1.Tx(__assign(__assign({}, tx), { body: new cardano_ledger_ts_1.TxBody(__assign(__assign({}, tx.body), { scriptDataHash: getScriptDataHash(tx.witnesses, (0, cardano_costmodels_ts_1.costModelsToLanguageViewCbor)(this.protocolParamters.costModels, { mustHaveV2: true, mustHaveV1: false }).toBuffer()) })), witnesses: new cardano_ledger_ts_1.TxWitnessSet(__assign(__assign({}, tx.witnesses), { vkeyWitnesses: [], redeemers: newRedeemers })) })); | ||
return new cardano_ledger_ts_1.Tx(__assign(__assign({}, tx), { body: new cardano_ledger_ts_1.TxBody(__assign(__assign({}, tx.body), { scriptDataHash: getScriptDataHash(tx.witnesses, (0, cardano_costmodels_ts_1.costModelsToLanguageViewCbor)(this.protocolParamters.costModels, opts).toBuffer()) })), witnesses: new cardano_ledger_ts_1.TxWitnessSet(__assign(__assign({}, tx.witnesses), { vkeyWitnesses: [], redeemers: newRedeemers })) })); | ||
}; | ||
@@ -448,3 +450,3 @@ TxBuilder.prototype.buildSync = function (buildArgs, _a) { | ||
"output lovelaces : ".concat(out.value.lovelaces.toString(), "\n") + | ||
"tx output: ".concat(JSON.stringify(out.toJson(), undefined, 2))); | ||
"tx output: ".concat((0, stringify_1.stringify)(out.toJson(), undefined, 2))); | ||
} | ||
@@ -884,3 +886,3 @@ }; | ||
throw new Error("total collateral value was including non-ADA value;\n" + | ||
"total collateral value was: ".concat(JSON.stringify(realCollValue.toJson(), undef, 2))); | ||
"total collateral value was: ".concat((0, stringify_1.stringify)(realCollValue.toJson(), undef, 2))); | ||
} | ||
@@ -1077,3 +1079,3 @@ } | ||
"error message: ".concat(result.msg, "\n") + | ||
"additional infos: ".concat(JSON.stringify(result.addInfos, function (k, v) { | ||
"additional infos: ".concat((0, stringify_1.stringify)(result.addInfos, function (k, v) { | ||
if ((0, uint8array_utils_1.isUint8Array)(v)) | ||
@@ -1080,0 +1082,0 @@ return (0, uint8array_utils_1.toHex)(v); |
{ | ||
"name": "@harmoniclabs/plu-ts-offchain", | ||
"version": "0.1.15", | ||
"version": "0.1.16-dev0", | ||
"description": "An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
263809
82
4929