scryptlib
Advanced tools
Comparing version 0.2.4 to 0.2.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ABICoder = exports.FunctionCall = exports.ABIEntityType = void 0; | ||
const ts_optchain_1 = require("ts-optchain"); | ||
@@ -4,0 +5,0 @@ const utils_1 = require("./utils"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.compilerVersion = exports.compile = exports.DebugModeTag = exports.CompileErrorType = void 0; | ||
const path_1 = require("path"); | ||
@@ -4,0 +5,0 @@ const child_process_1 = require("child_process"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.buildContractClass = exports.AbstractContract = void 0; | ||
const abi_1 = require("./abi"); | ||
@@ -4,0 +5,0 @@ const utils_1 = require("./utils"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var contract_1 = require("./contract"); | ||
exports.buildContractClass = contract_1.buildContractClass; | ||
Object.defineProperty(exports, "buildContractClass", { enumerable: true, get: function () { return contract_1.buildContractClass; } }); | ||
var compilerWrapper_1 = require("./compilerWrapper"); | ||
exports.compile = compilerWrapper_1.compile; | ||
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compilerWrapper_1.compile; } }); | ||
var utils_1 = require("./utils"); | ||
exports.bsv = utils_1.bsv; | ||
exports.signTx = utils_1.signTx; | ||
exports.toHex = utils_1.toHex; | ||
exports.getPreimage = utils_1.getPreimage; | ||
exports.num2bin = utils_1.num2bin; | ||
Object.defineProperty(exports, "bsv", { enumerable: true, get: function () { return utils_1.bsv; } }); | ||
Object.defineProperty(exports, "signTx", { enumerable: true, get: function () { return utils_1.signTx; } }); | ||
Object.defineProperty(exports, "toHex", { enumerable: true, get: function () { return utils_1.toHex; } }); | ||
Object.defineProperty(exports, "getPreimage", { enumerable: true, get: function () { return utils_1.getPreimage; } }); | ||
Object.defineProperty(exports, "num2bin", { enumerable: true, get: function () { return utils_1.num2bin; } }); | ||
var scryptTypes_1 = require("./scryptTypes"); | ||
exports.Int = scryptTypes_1.Int; | ||
exports.Bool = scryptTypes_1.Bool; | ||
exports.Bytes = scryptTypes_1.Bytes; | ||
exports.PrivKey = scryptTypes_1.PrivKey; | ||
exports.PubKey = scryptTypes_1.PubKey; | ||
exports.Sig = scryptTypes_1.Sig; | ||
exports.Ripemd160 = scryptTypes_1.Ripemd160; | ||
exports.Sha1 = scryptTypes_1.Sha1; | ||
exports.Sha256 = scryptTypes_1.Sha256; | ||
exports.SigHashType = scryptTypes_1.SigHashType; | ||
exports.SigHashPreimage = scryptTypes_1.SigHashPreimage; | ||
exports.OpCodeType = scryptTypes_1.OpCodeType; | ||
Object.defineProperty(exports, "Int", { enumerable: true, get: function () { return scryptTypes_1.Int; } }); | ||
Object.defineProperty(exports, "Bool", { enumerable: true, get: function () { return scryptTypes_1.Bool; } }); | ||
Object.defineProperty(exports, "Bytes", { enumerable: true, get: function () { return scryptTypes_1.Bytes; } }); | ||
Object.defineProperty(exports, "PrivKey", { enumerable: true, get: function () { return scryptTypes_1.PrivKey; } }); | ||
Object.defineProperty(exports, "PubKey", { enumerable: true, get: function () { return scryptTypes_1.PubKey; } }); | ||
Object.defineProperty(exports, "Sig", { enumerable: true, get: function () { return scryptTypes_1.Sig; } }); | ||
Object.defineProperty(exports, "Ripemd160", { enumerable: true, get: function () { return scryptTypes_1.Ripemd160; } }); | ||
Object.defineProperty(exports, "Sha1", { enumerable: true, get: function () { return scryptTypes_1.Sha1; } }); | ||
Object.defineProperty(exports, "Sha256", { enumerable: true, get: function () { return scryptTypes_1.Sha256; } }); | ||
Object.defineProperty(exports, "SigHashType", { enumerable: true, get: function () { return scryptTypes_1.SigHashType; } }); | ||
Object.defineProperty(exports, "SigHashPreimage", { enumerable: true, get: function () { return scryptTypes_1.SigHashPreimage; } }); | ||
Object.defineProperty(exports, "OpCodeType", { enumerable: true, get: function () { return scryptTypes_1.OpCodeType; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -77,3 +77,3 @@ export declare abstract class ScryptType { | ||
get sighashType(): number; | ||
toString(): string; | ||
toString(format?: string): string; | ||
toLiteral(): string; | ||
@@ -80,0 +80,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OpCodeType = exports.SigHashPreimage = exports.SigHashType = exports.SigHash = exports.Sha256 = exports.Sha1 = exports.Ripemd160 = exports.Sig = exports.PubKey = exports.PrivKey = exports.Bytes = exports.Bool = exports.Int = exports.ScryptType = void 0; | ||
const utils_1 = require("./utils"); | ||
@@ -215,4 +216,4 @@ class ScryptType { | ||
} | ||
toString() { | ||
return this._buf.toString('hex'); | ||
toString(format = 'hex') { | ||
return this._buf.toString(format); | ||
} | ||
@@ -219,0 +220,0 @@ toLiteral() { |
@@ -0,1 +1,2 @@ | ||
import { SigHashPreimage } from "./scryptTypes"; | ||
import bsv = require('bsv'); | ||
@@ -22,5 +23,5 @@ export { bsv }; | ||
}): string; | ||
export declare function getPreimage(tx: any, inputLockingScriptASM: string, inputAmount: number, inputIndex?: number, sighashType?: number, flags?: number): any; | ||
export declare function getPreimage(tx: any, inputLockingScriptASM: string, inputAmount: number, inputIndex?: number, sighashType?: number, flags?: number): SigHashPreimage; | ||
export declare function num2bin(n: number, dataLen: number): string; | ||
export declare function path2uri(path: string): string; | ||
export declare function uri2path(uri: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.uri2path = exports.path2uri = exports.num2bin = exports.getPreimage = exports.toHex = exports.signTx = exports.getValidatedHexString = exports.hexStringToBytes = exports.bytesToHexString = exports.bytes2Literal = exports.literal2Asm = exports.int2Asm = exports.bool2Asm = exports.DEFAULT_SIGHASH_TYPE = exports.DEFAULT_FLAGS = exports.bsv = void 0; | ||
const url_1 = require("url"); | ||
const scryptTypes_1 = require("./scryptTypes"); | ||
const bsv = require("bsv"); | ||
@@ -8,6 +10,7 @@ exports.bsv = bsv; | ||
const Interpreter = bsv.Script.Interpreter; | ||
exports.DEFAULT_FLAGS = Interpreter.SCRIPT_VERIFY_MINIMALDATA | | ||
Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID | | ||
Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES | | ||
Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES; | ||
exports.DEFAULT_FLAGS = Interpreter.SCRIPT_VERIFY_MINIMALDATA | ||
| Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID | ||
| Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES | ||
| Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES | ||
| Interpreter.SCRIPT_VERIFY_NULLFAIL; | ||
exports.DEFAULT_SIGHASH_TYPE = bsv.crypto.Signature.SIGHASH_ALL | bsv.crypto.Signature.SIGHASH_FORKID; | ||
@@ -187,3 +190,4 @@ function bool2Asm(str) { | ||
function getPreimage(tx, inputLockingScriptASM, inputAmount, inputIndex = 0, sighashType = exports.DEFAULT_SIGHASH_TYPE, flags = exports.DEFAULT_FLAGS) { | ||
return bsv.Transaction.sighash.sighashPreimage(tx, sighashType, inputIndex, bsv.Script.fromASM(inputLockingScriptASM), new bsv.crypto.BN(inputAmount), flags); | ||
const preimageBuf = bsv.Transaction.sighash.sighashPreimage(tx, sighashType, inputIndex, bsv.Script.fromASM(inputLockingScriptASM), new bsv.crypto.BN(inputAmount), flags); | ||
return new scryptTypes_1.SigHashPreimage(preimageBuf.toString('hex')); | ||
} | ||
@@ -190,0 +194,0 @@ exports.getPreimage = getPreimage; |
{ | ||
"name": "scryptlib", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Javascript SDK for integration of Bitcoin SV Smart Contracts written in sCrypt language.", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
58458
1273