@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
20 lines (19 loc) • 913 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PCredential = void 0;
var pstruct_1 = require("../../../PTypes/PStruct/pstruct.js");
var data_1 = require("../../../lib/builtins/data/index.js");
var pfn_1 = require("../../../lib/pfn.js");
var phoist_1 = require("../../../lib/phoist.js");
var types_1 = require("../../../type_system/types.js");
var PPubKeyHash_1 = require("../PubKey/PPubKeyHash.js");
var PValidatorHash_1 = require("../ScriptsHashes/PValidatorHash.js");
exports.PCredential = (0, pstruct_1.pstruct)({
PPubKeyCredential: { pkh: PPubKeyHash_1.PPubKeyHash.type },
PScriptCredential: { valHash: PValidatorHash_1.PValidatorHash.type },
}, function (self_t) {
var pcredHash = (0, phoist_1.phoist)((0, pfn_1.pfn)([self_t], types_1.bs)(function (self) { return data_1.punBData.$(self.raw.fields.head); }));
return {
hash: pcredHash
};
});