Socket
Socket
Sign inDemoInstall

@taquito/local-forging

Package Overview
Dependencies
Maintainers
4
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taquito/local-forging - npm Package Compare versions

Comparing version 16.1.2 to 16.2.0-beta-RC.0

dist/lib/errors.js

46

dist/lib/codec.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.txRollupIdDecoder = exports.txRollupIdEncoder = exports.txRollupOriginationParamDecoder = exports.txRollupOriginationParamEncoder = exports.entrypointNameDecoder = exports.entrypointNameEncoder = exports.blockPayloadHashDecoder = exports.blockPayloadHashEncoder = exports.valueParameterDecoder = exports.valueParameterEncoder = exports.parametersEncoder = exports.entrypointEncoder = exports.parametersDecoder = exports.entrypointDecoder = exports.zarithDecoder = exports.zarithEncoder = exports.smartRollupCommitmentHashDecoder = exports.smartContractAddressDecoder = exports.smartRollupAddressDecoder = exports.addressDecoder = exports.smartRollupContractAddressEncoder = exports.publicKeyDecoder = exports.smartContractAddressEncoder = exports.smartRollupAddressEncoder = exports.addressEncoder = exports.publicKeyEncoder = exports.pkhEncoder = exports.delegateDecoder = exports.boolDecoder = exports.int16Decoder = exports.int16Encoder = exports.int32Decoder = exports.int32Encoder = exports.delegateEncoder = exports.pvmKindDecoder = exports.pvmKindEncoder = exports.ballotDecoder = exports.ballotEncoder = exports.proposalsEncoder = exports.proposalsDecoder = exports.proposalDecoder = exports.proposalEncoder = exports.boolEncoder = exports.tz1Encoder = exports.branchEncoder = exports.pkhDecoder = exports.branchDecoder = exports.tz1Decoder = exports.prefixDecoder = exports.prefixEncoder = void 0;
exports.txRollupIdDecoder = exports.txRollupIdEncoder = exports.txRollupOriginationParamDecoder = exports.txRollupOriginationParamEncoder = exports.entrypointNameDecoder = exports.entrypointNameEncoder = exports.blockPayloadHashDecoder = exports.blockPayloadHashEncoder = exports.valueParameterDecoder = exports.valueParameterEncoder = exports.parametersEncoder = exports.entrypointEncoder = exports.parametersDecoder = exports.entrypointDecoder = exports.zarithDecoder = exports.zarithEncoder = exports.smartRollupCommitmentHashDecoder = exports.smartContractAddressDecoder = exports.smartRollupAddressDecoder = exports.addressDecoder = exports.smartRollupCommitmentHashEncoder = exports.publicKeyDecoder = exports.smartContractAddressEncoder = exports.smartRollupAddressEncoder = exports.addressEncoder = exports.publicKeyEncoder = exports.pkhEncoder = exports.delegateDecoder = exports.boolDecoder = exports.int16Decoder = exports.int16Encoder = exports.int32Decoder = exports.int32Encoder = exports.delegateEncoder = exports.pvmKindDecoder = exports.pvmKindEncoder = exports.ballotDecoder = exports.ballotEncoder = exports.proposalsEncoder = exports.proposalsDecoder = exports.proposalDecoder = exports.proposalEncoder = exports.boolEncoder = exports.tz1Encoder = exports.branchEncoder = exports.pkhDecoder = exports.branchDecoder = exports.tz1Decoder = exports.prefixDecoder = exports.prefixEncoder = void 0;
exports.smartRollupMessageDecoder = exports.smartRollupMessageEncoder = exports.paddedBytesDecoder = exports.paddedBytesEncoder = exports.depositsLimitDecoder = exports.depositsLimitEncoder = exports.burnLimitDecoder = exports.burnLimitEncoder = exports.txRollupBatchContentDecoder = exports.txRollupBatchContentEncoder = void 0;
const utils_1 = require("@taquito/utils");
const error_1 = require("./error");
const errors_1 = require("./errors");
const bignumber_js_1 = require("bignumber.js");

@@ -12,2 +12,3 @@ const constants_1 = require("./constants");

const utils_2 = require("./utils");
const core_1 = require("@taquito/core");
// https://tezos.gitlab.io/shell/p2p_api.html specifies data types and structure for forging

@@ -72,3 +73,3 @@ const prefixEncoder = (prefix) => (str) => {

default:
throw new error_1.InvalidBallotValueError(ballot);
throw new errors_1.InvalidBallotValueError(ballot);
}

@@ -87,3 +88,3 @@ };

default:
throw new error_1.DecodeBallotValueError(value[0].toString());
throw new errors_1.DecodeBallotValueError(value[0].toString());
}

@@ -99,3 +100,3 @@ };

default:
throw new error_1.UnsupportedPvmKindError(pvm);
throw new errors_1.UnsupportedPvmKindError(pvm);
}

@@ -112,3 +113,3 @@ };

default:
throw new error_1.DecodePvmKindError(value[0].toString());
throw new errors_1.DecodePvmKindError(value[0].toString());
}

@@ -188,3 +189,4 @@ };

default:
throw new utils_1.InvalidKeyHashError(val);
throw new utils_1.InvalidKeyHashError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) +
` expecting one for the following "${utils_1.Prefix.TZ1}", "${utils_1.Prefix.TZ2}", "${utils_1.Prefix.TZ3}" or "${utils_1.Prefix.TZ4}".`);
}

@@ -203,3 +205,4 @@ };

default:
throw new utils_1.InvalidPublicKeyError(val);
throw new utils_1.InvalidPublicKeyError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) +
` expecting one of the following '${utils_1.Prefix.EDPK}', '${utils_1.Prefix.SPPK}', '${utils_1.Prefix.P2PK}' or '${utils_1.Prefix.BLPK}'.`);
}

@@ -219,3 +222,4 @@ };

default:
throw new utils_1.InvalidAddressError(val);
throw new core_1.InvalidAddressError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) +
` expecting one of the following prefix '${utils_1.Prefix.TZ1}', ${utils_1.Prefix.TZ2}', '${utils_1.Prefix.TZ3}', '${utils_1.Prefix.TZ4}' or '${utils_1.Prefix.KT1}'.`);
}

@@ -226,3 +230,3 @@ };

if (val.substring(0, 3) !== utils_1.Prefix.SR1) {
throw new error_1.InvalidSmartRollupAddressError(val);
throw new errors_1.InvalidSmartRollupAddressError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${utils_1.Prefix.SR1}'.`);
}

@@ -237,3 +241,3 @@ return exports.prefixEncoder(utils_1.Prefix.SR1)(val);

}
throw new utils_1.InvalidContractAddressError(val);
throw new core_1.InvalidContractAddressError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${utils_1.Prefix.KT1}'.`);
};

@@ -251,7 +255,7 @@ exports.smartContractAddressEncoder = smartContractAddressEncoder;

default:
throw new utils_1.InvalidPublicKeyError(val.toString());
throw new utils_1.InvalidPublicKeyError(val.toString(), utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED));
}
};
exports.publicKeyDecoder = publicKeyDecoder;
const smartRollupContractAddressEncoder = (val) => {
const smartRollupCommitmentHashEncoder = (val) => {
const prefix = val.substring(0, 4);

@@ -261,5 +265,5 @@ if (prefix === utils_1.Prefix.SRC1) {

}
throw new error_1.InvalidSmartRollupContractAddressError(val);
throw new errors_1.InvalidSmartRollupCommitmentHashError(val, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${utils_1.Prefix.SRC1}'`);
};
exports.smartRollupContractAddressEncoder = smartRollupContractAddressEncoder;
exports.smartRollupCommitmentHashEncoder = smartRollupCommitmentHashEncoder;
const addressDecoder = (val) => {

@@ -276,3 +280,3 @@ const preamble = val.consume(1);

default:
throw new utils_1.InvalidAddressError(val.toString());
throw new core_1.InvalidAddressError(val.toString(), ': Unable to decode.');
}

@@ -284,3 +288,3 @@ };

if (address.substring(0, 3) !== utils_1.Prefix.SR1) {
throw new utils_1.InvalidAddressError(address);
throw new errors_1.InvalidSmartRollupAddressError(address, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${utils_1.Prefix.SR1}'.`);
}

@@ -297,3 +301,3 @@ return address;

}
throw new utils_1.InvalidContractAddressError(val.toString());
throw new core_1.InvalidContractAddressError(val.toString(), utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED));
};

@@ -304,3 +308,3 @@ exports.smartContractAddressDecoder = smartContractAddressDecoder;

if (address.substring(0, 4) !== utils_1.Prefix.SRC1) {
throw new error_1.InvalidSmartRollupContractAddressError(address);
throw new errors_1.InvalidSmartRollupCommitmentHashError(address, utils_1.invalidErrorDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${utils_1.Prefix.SRC1}'`);
}

@@ -359,3 +363,3 @@ return address;

if (entrypoint.length > constants_1.ENTRYPOINT_MAX_LENGTH) {
throw new error_1.OversizedEntryPointError(entrypoint);
throw new errors_1.OversizedEntryPointError(entrypoint);
}

@@ -388,3 +392,3 @@ return entrypoint;

if (entrypoint.length > constants_1.ENTRYPOINT_MAX_LENGTH) {
throw new error_1.OversizedEntryPointError(entrypoint);
throw new errors_1.OversizedEntryPointError(entrypoint);
}

@@ -391,0 +395,0 @@ const value = { string: entrypoint };

@@ -26,3 +26,3 @@ "use strict";

[constants_1.CODEC.SMART_CONTRACT_ADDRESS]: codec_1.smartContractAddressEncoder,
[constants_1.CODEC.SMART_ROLLUP_COMMITMENT_HASH]: codec_1.smartRollupContractAddressEncoder,
[constants_1.CODEC.SMART_ROLLUP_COMMITMENT_HASH]: codec_1.smartRollupCommitmentHashEncoder,
[constants_1.CODEC.VALUE]: codec_1.valueParameterEncoder,

@@ -29,0 +29,0 @@ [constants_1.CODEC.INT16]: codec_1.int16Encoder,

@@ -8,3 +8,4 @@ "use strict";

const utils_1 = require("../utils");
const error_1 = require("../error");
const errors_1 = require("../errors");
const core_1 = require("@taquito/core");
const isPrim = (value) => {

@@ -59,3 +60,3 @@ return 'prim' in value;

}
throw new error_1.UnexpectedMichelsonValueError(JSON.stringify(value));
throw new errors_1.UnexpectedMichelsonValueError(JSON.stringify(value));
};

@@ -111,3 +112,3 @@ exports.valueEncoder = valueEncoder;

if (!/^([A-Fa-f0-9]{2})*$/.test(value.bytes)) {
throw new error_1.InvalidHexStringError(value.bytes);
throw new core_1.InvalidHexStringError(value.bytes);
}

@@ -114,0 +115,0 @@ const len = value.bytes.length / 2;

@@ -5,4 +5,4 @@ "use strict";

const constants_1 = require("../constants");
const utils_1 = require("@taquito/utils");
const error_1 = require("../error");
const core_1 = require("@taquito/core");
const errors_1 = require("../errors");
exports.ManagerOperationSchema = {

@@ -173,3 +173,3 @@ branch: constants_1.CODEC.BRANCH,

if (!(operation.kind in encoders) || !(operation.kind in constants_1.kindMappingReverse)) {
throw new utils_1.InvalidOperationKindError(operation.kind);
throw new core_1.InvalidOperationKindError(operation.kind);
}

@@ -183,7 +183,7 @@ return constants_1.kindMappingReverse[operation.kind] + encoders[operation.kind](operation);

if (operationName === undefined) {
throw new error_1.UnsupportedOperationError(op[0].toString());
throw new errors_1.UnsupportedOperationError(op[0].toString());
}
const decodedObj = decoders[operationName](value);
if (typeof decodedObj !== 'object') {
throw new error_1.OperationDecodingError('Decoded invalid operation');
throw new errors_1.OperationDecodingError('Invalid operation, cannot be decoded.');
}

@@ -201,3 +201,3 @@ return Object.assign({ kind: operationName }, decodedObj);

if (!Array.isArray(values)) {
throw new error_1.OperationEncodingError(`Expected value to be Array ${JSON.stringify(values)}`);
throw new errors_1.OperationEncodingError(`Invalid operation value "${JSON.stringify(values)}" of key "${key}, expected value to be Array.`);
}

@@ -224,3 +224,3 @@ return prev + values.reduce((prevBytes, current) => prevBytes + encoder(current), '');

if (lastLength === value.length()) {
throw new error_1.OperationDecodingError('Unable to decode value');
throw new errors_1.OperationDecodingError('Unable to decode value');
}

@@ -227,0 +227,0 @@ }

@@ -23,5 +23,6 @@ "use strict";

const utils_1 = require("@taquito/utils");
const error_1 = require("./error");
const errors_1 = require("./errors");
const validator_1 = require("./validator");
const protocols_1 = require("./protocols");
const core_1 = require("@taquito/core");
var constants_2 = require("./constants");

@@ -56,8 +57,9 @@ Object.defineProperty(exports, "CODEC", { enumerable: true, get: function () { return constants_2.CODEC; } });

forge(params) {
if (utils_1.validateBlock(params.branch) !== utils_1.ValidationResult.VALID) {
throw new error_1.InvalidBlockHashError(`The block hash ${params.branch} is invalid`);
const branchValidation = utils_1.validateBlock(params.branch);
if (branchValidation !== utils_1.ValidationResult.VALID) {
throw new core_1.InvalidBlockHashError(params.branch, utils_1.invalidErrorDetail(branchValidation));
}
for (const content of params.contents) {
if (!validator_1.validateOperationKind(content.kind)) {
throw new utils_1.InvalidOperationKindError(content.kind);
throw new core_1.InvalidOperationKindError(content.kind);
}

@@ -83,7 +85,7 @@ const diff = validator_1.validateMissingProperty(content);

else {
throw new error_1.InvalidOperationSchemaError(`Missing properties: ${diff.join(', ').toString()}`);
throw new errors_1.InvalidOperationSchemaError(content, `missing properties "${diff.join(', ')}"`);
}
}
else if (diff.length > 1) {
throw new error_1.InvalidOperationSchemaError(`Missing properties: ${diff.join(', ').toString()}`);
throw new errors_1.InvalidOperationSchemaError(content, `missing properties "${diff.join(', ')}"`);
}

@@ -90,0 +92,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Uint8ArrayConsumer = void 0;
const error_1 = require("./error");
const core_1 = require("@taquito/core");
class Uint8ArrayConsumer {

@@ -17,3 +17,3 @@ constructor(arr, offset = 0) {

else {
throw new error_1.InvalidHexStringError(lowHex);
throw new core_1.InvalidHexStringError(lowHex);
}

@@ -20,0 +20,0 @@ }

@@ -6,5 +6,5 @@ "use strict";

exports.VERSION = {
"commitHash": "bcc2118ddfafc1995fd125cd74d198fda042bf48",
"version": "16.1.2"
"commitHash": "babcbaf464fd3571a3b88cf7023fefe87809d86d",
"version": "16.2.0-beta-RC.0"
};
//# sourceMappingURL=version.js.map

@@ -1,2 +0,3 @@

import { Prefix, buf2hex, b58cdecode, prefix, prefixLength, b58cencode, InvalidKeyHashError, InvalidPublicKeyError, InvalidAddressError, InvalidContractAddressError, InvalidOperationKindError, validateBlock, ValidationResult } from '@taquito/utils';
import { Prefix, buf2hex, b58cdecode, prefix, prefixLength, b58cencode, InvalidKeyHashError, invalidErrorDetail, ValidationResult, InvalidPublicKeyError, validateBlock } from '@taquito/utils';
import { ParameterValidationError, InvalidHexStringError, InvalidAddressError, InvalidContractAddressError, InvalidOperationKindError, InvalidBlockHashError } from '@taquito/core';
import BigNumber$1, { BigNumber } from 'bignumber.js';

@@ -287,19 +288,10 @@

* @category Error
* @description Error that indicates an invalid block hash being passed or used
*/
class InvalidBlockHashError extends Error {
constructor(message) {
super(message);
this.message = message;
this.name = 'InvalidBlockHashError';
}
}
/**
* @category Error
* @description Error that indicates an invalid operation schema being passed or used
*/ class InvalidOperationSchemaError extends Error {
constructor(message) {
super(message);
this.message = message;
* @description Error indicates an invalid operation content being passed or used
*/ class InvalidOperationSchemaError extends ParameterValidationError {
constructor(operation, errorDetail) {
super();
this.operation = operation;
this.name = 'InvalidOperationSchemaError';
this.message = `Invalid operation content recevied`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}

@@ -309,9 +301,10 @@ }

* @category Error
* @description Error that indicates an entrypoint exceeding maximum size
* @description Error indicates an entrypoint name exceeding maximum length
*/
class OversizedEntryPointError extends Error {
class OversizedEntryPointError extends ParameterValidationError {
constructor(entrypoint) {
super(`Oversized entrypoint: ${entrypoint}. The maximum length of entrypoint is ${ENTRYPOINT_MAX_LENGTH}`);
super();
this.entrypoint = entrypoint;
this.name = 'OversizedEntryPointError';
this.message = `Invalid entrypoint length "${entrypoint.length}", maximum length is "${ENTRYPOINT_MAX_LENGTH}".`;
}

@@ -321,9 +314,10 @@ }

* @category Error
* @description Error that indicates an invalid ballot value
* @description Error indicates an invalid ballot value being used
*/
class InvalidBallotValueError extends Error {
class InvalidBallotValueError extends ParameterValidationError {
constructor(ballotValue) {
super(`The ballot value '${ballotValue}' is invalid`);
super();
this.ballotValue = ballotValue;
this.name = 'InvalidBallotValueError';
this.message = `Invalid ballot value "${ballotValue}" expecting one of the following: "yay", "nay", "pass".`;
}

@@ -333,9 +327,10 @@ }

* @category Error
* @description Error that indicates a failure when trying to decode ballot value
* @description Error indicates a failure when trying to decode ballot value
*/
class DecodeBallotValueError extends Error {
class DecodeBallotValueError extends ParameterValidationError {
constructor(ballotValue) {
super(`Failed to decode ballot value ${ballotValue}`);
super();
this.ballotValue = ballotValue;
this.name = 'DecodeBallotValueError';
this.message = `Invalid ballot value "${ballotValue}", cannot be decoded.`;
}

@@ -345,20 +340,10 @@ }

* @category Error
* @description Error that indicates an invalid hex string have been passed or used
* @description Error indicates unexpected Michelson Value being passed or used
*/
class InvalidHexStringError extends Error {
constructor(hexString) {
super(`The hex string '${hexString}' is invalid`);
this.hexString = hexString;
this.name = 'InvalidHexStringError';
}
}
/**
* @category Error
* @description Error that indicates unexpected Michelson Value being passed or used
*/
class UnexpectedMichelsonValueError extends Error {
class UnexpectedMichelsonValueError extends ParameterValidationError {
constructor(value) {
super(`Failed to encode michelson value '${value}'`);
super();
this.value = value;
this.name = 'UnexpectedMichelsonValueError';
this.message = `Invalid Michelson value "${value}", unalbe to encode.`;
}

@@ -368,7 +353,7 @@ }

* @category Error
* @description Error that indicates a failure when trying to decode an operation
* @description Error indicates a failure when trying to decode an operation
*/
class OperationDecodingError extends Error {
class OperationDecodingError extends ParameterValidationError {
constructor(message) {
super(message);
super();
this.message = message;

@@ -380,7 +365,7 @@ this.name = 'OperationDecodingError';

* @category Error
* @description Error that indicates a failure when trying to encode an operation
* @description Error indicates a failure when trying to encode an operation
*/
class OperationEncodingError extends Error {
class OperationEncodingError extends ParameterValidationError {
constructor(message) {
super(message);
super();
this.message = message;

@@ -392,9 +377,10 @@ this.name = 'OperationEncodingError';

* @category Error
* @description Error that indicates an unsupported operation being passed or used
* @description Error indicates an unsupported operation being passed or used
*/
class UnsupportedOperationError extends Error {
class UnsupportedOperationError extends ParameterValidationError {
constructor(op) {
super(`The operation '${op}' is unsupported`);
super();
this.op = op;
this.name = 'UnsupportedOperationError';
this.message = `Unsupported operation "${op}", can submit an issue on our github for feature request.`;
}

@@ -404,9 +390,10 @@ }

* @cateogry Error
* @description Error that indicates an unsupported pvm being passed or used
* @description Error indicates an unsupported pvm being passed or used
*/
class UnsupportedPvmKindError extends Error {
class UnsupportedPvmKindError extends ParameterValidationError {
constructor(pvm) {
super(`The Pvm "${pvm}" is not supported`);
super();
this.pvm = pvm;
this.name = 'UnsupportedPvmKindError';
this.message = `Invalid Pvm kind "${pvm}" expecting either "arith" or "wasm_2_0_0".`;
}

@@ -416,9 +403,10 @@ }

* @category Error
* @description Error that indicates an unsupported decoded pvm
* @description Error indicates an unsupported pvm to decode
*/
class DecodePvmKindError extends Error {
class DecodePvmKindError extends ParameterValidationError {
constructor(pvm) {
super(`The encoded Pvm ${pvm} is not supported`);
super();
this.pvm = pvm;
this.name = 'DecodePvmKindError';
this.message = `Invalid Pvm kind "${pvm}", cannot be decoded.`;
}

@@ -428,9 +416,11 @@ }

* @category Error
* @description Error that indicates an invalid Smart Rollup Address (sr1)
* @description Error indicates an invalid Smart Rollup Address (sr1)
*/
class InvalidSmartRollupAddressError extends Error {
constructor(address) {
super(`The Smart Rollup Contract Address: ${address} is invalid`);
class InvalidSmartRollupAddressError extends ParameterValidationError {
constructor(address, errorDetail) {
super();
this.address = address;
this.name = 'InvalidSmartRollupContractAddress';
this.name = 'InvalidSmartRollupAddress';
this.message = `Invalid smart rollup address "${address}"`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}

@@ -440,9 +430,11 @@ }

* @category Error
* @description Error that indicates an invalid Smart Rollup Contract Address (src1)
* @description Error indicates an invalid Smart Rollup commitment hash (src1)
*/
class InvalidSmartRollupContractAddressError extends Error {
constructor(address) {
super(`The Smart Rollup Contract Address: ${address} is invalid`);
this.address = address;
this.name = 'InvalidSmartRollupContractAddress';
class InvalidSmartRollupCommitmentHashError extends ParameterValidationError {
constructor(hash, errorDetail) {
super();
this.hash = hash;
this.name = 'InvalidSmartRollupCommitmentHashError';
this.message = `Invalid smart rollup commitment hash "${hash}"`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}

@@ -887,3 +879,4 @@ }

default:
throw new InvalidKeyHashError(val);
throw new InvalidKeyHashError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) +
` expecting one for the following "${Prefix.TZ1}", "${Prefix.TZ2}", "${Prefix.TZ3}" or "${Prefix.TZ4}".`);
}

@@ -901,3 +894,4 @@ };

default:
throw new InvalidPublicKeyError(val);
throw new InvalidPublicKeyError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) +
` expecting one of the following '${Prefix.EDPK}', '${Prefix.SPPK}', '${Prefix.P2PK}' or '${Prefix.BLPK}'.`);
}

@@ -916,3 +910,4 @@ };

default:
throw new InvalidAddressError(val);
throw new InvalidAddressError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) +
` expecting one of the following prefix '${Prefix.TZ1}', ${Prefix.TZ2}', '${Prefix.TZ3}', '${Prefix.TZ4}' or '${Prefix.KT1}'.`);
}

@@ -922,3 +917,3 @@ };

if (val.substring(0, 3) !== Prefix.SR1) {
throw new InvalidSmartRollupAddressError(val);
throw new InvalidSmartRollupAddressError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${Prefix.SR1}'.`);
}

@@ -932,3 +927,3 @@ return prefixEncoder(Prefix.SR1)(val);

}
throw new InvalidContractAddressError(val);
throw new InvalidContractAddressError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${Prefix.KT1}'.`);
};

@@ -945,6 +940,6 @@ const publicKeyDecoder = (val) => {

default:
throw new InvalidPublicKeyError(val.toString());
throw new InvalidPublicKeyError(val.toString(), invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED));
}
};
const smartRollupContractAddressEncoder = (val) => {
const smartRollupCommitmentHashEncoder = (val) => {
const prefix = val.substring(0, 4);

@@ -954,3 +949,3 @@ if (prefix === Prefix.SRC1) {

}
throw new InvalidSmartRollupContractAddressError(val);
throw new InvalidSmartRollupCommitmentHashError(val, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${Prefix.SRC1}'`);
};

@@ -968,3 +963,3 @@ const addressDecoder = (val) => {

default:
throw new InvalidAddressError(val.toString());
throw new InvalidAddressError(val.toString(), ': Unable to decode.');
}

@@ -975,3 +970,3 @@ };

if (address.substring(0, 3) !== Prefix.SR1) {
throw new InvalidAddressError(address);
throw new InvalidSmartRollupAddressError(address, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${Prefix.SR1}'.`);
}

@@ -987,3 +982,3 @@ return address;

}
throw new InvalidContractAddressError(val.toString());
throw new InvalidContractAddressError(val.toString(), invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED));
};

@@ -993,3 +988,3 @@ const smartRollupCommitmentHashDecoder = (val) => {

if (address.substring(0, 4) !== Prefix.SRC1) {
throw new InvalidSmartRollupContractAddressError(address);
throw new InvalidSmartRollupCommitmentHashError(address, invalidErrorDetail(ValidationResult.NO_PREFIX_MATCHED) + ` expecting prefix '${Prefix.SRC1}'`);
}

@@ -1333,3 +1328,3 @@ return address;

if (typeof decodedObj !== 'object') {
throw new OperationDecodingError('Decoded invalid operation');
throw new OperationDecodingError('Invalid operation, cannot be decoded.');
}

@@ -1346,3 +1341,3 @@ return Object.assign({ kind: operationName }, decodedObj);

if (!Array.isArray(values)) {
throw new OperationEncodingError(`Expected value to be Array ${JSON.stringify(values)}`);
throw new OperationEncodingError(`Invalid operation value "${JSON.stringify(values)}" of key "${key}, expected value to be Array.`);
}

@@ -1459,3 +1454,3 @@ return prev + values.reduce((prevBytes, current) => prevBytes + encoder(current), '');

[CODEC.SMART_CONTRACT_ADDRESS]: smartContractAddressEncoder,
[CODEC.SMART_ROLLUP_COMMITMENT_HASH]: smartRollupContractAddressEncoder,
[CODEC.SMART_ROLLUP_COMMITMENT_HASH]: smartRollupCommitmentHashEncoder,
[CODEC.VALUE]: valueParameterEncoder,

@@ -1569,4 +1564,4 @@ [CODEC.INT16]: int16Encoder,

const VERSION = {
"commitHash": "bcc2118ddfafc1995fd125cd74d198fda042bf48",
"version": "16.1.2"
"commitHash": "babcbaf464fd3571a3b88cf7023fefe87809d86d",
"version": "16.2.0-beta-RC.0"
};

@@ -1594,4 +1589,5 @@

forge(params) {
if (validateBlock(params.branch) !== ValidationResult.VALID) {
throw new InvalidBlockHashError(`The block hash ${params.branch} is invalid`);
const branchValidation = validateBlock(params.branch);
if (branchValidation !== ValidationResult.VALID) {
throw new InvalidBlockHashError(params.branch, invalidErrorDetail(branchValidation));
}

@@ -1621,7 +1617,7 @@ for (const content of params.contents) {

else {
throw new InvalidOperationSchemaError(`Missing properties: ${diff.join(', ').toString()}`);
throw new InvalidOperationSchemaError(content, `missing properties "${diff.join(', ')}"`);
}
}
else if (diff.length > 1) {
throw new InvalidOperationSchemaError(`Missing properties: ${diff.join(', ').toString()}`);
throw new InvalidOperationSchemaError(content, `missing properties "${diff.join(', ')}"`);
}

@@ -1628,0 +1624,0 @@ }

@@ -33,3 +33,3 @@ import { Prefix } from '@taquito/utils';

export declare const publicKeyDecoder: (val: Uint8ArrayConsumer) => string;
export declare const smartRollupContractAddressEncoder: (val: string) => string;
export declare const smartRollupCommitmentHashEncoder: (val: string) => string;
export declare const addressDecoder: (val: Uint8ArrayConsumer) => string | undefined;

@@ -36,0 +36,0 @@ export declare const smartRollupAddressDecoder: (val: Uint8ArrayConsumer) => string;

{
"name": "@taquito/local-forging",
"version": "16.1.2",
"version": "16.2.0-beta-RC.0",
"description": "Provide local forging functionality to be with taquito",

@@ -71,7 +71,8 @@ "keywords": [

"dependencies": {
"@taquito/utils": "^16.1.2",
"@taquito/core": "^16.2.0-beta-RC.0",
"@taquito/utils": "^16.2.0-beta-RC.0",
"bignumber.js": "^9.1.0"
},
"devDependencies": {
"@taquito/rpc": "^16.1.2",
"@taquito/rpc": "^16.2.0-beta-RC.0",
"@types/bluebird": "^3.5.36",

@@ -109,3 +110,3 @@ "@types/estree": "^1.0.0",

},
"gitHead": "f44e0fa20e017142543cf0ad49fc8220021f6d1c"
"gitHead": "a909a1e61a626eb5a2e9ad269a80a96aceff4e28"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc