New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eosjs

Package Overview
Dependencies
Maintainers
4
Versions
292
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eosjs - npm Package Compare versions

Comparing version 22.0.0-rc2 to 22.0.0

12

dist/eosjs-api.js

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

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -198,3 +199,3 @@ var __values = (this && this.__values) || function(o) {

uniqueAccounts = new Set(accounts);
actionPromises = __spread(uniqueAccounts).map(function (account) { return __awaiter(_this, void 0, void 0, function () {
actionPromises = __spreadArray([], __read(uniqueAccounts)).map(function (account) { return __awaiter(_this, void 0, void 0, function () {
var _a;

@@ -400,3 +401,4 @@ return __generator(this, function (_b) {

return __awaiter(this, void 0, void 0, function () {
var info, abis, _e, _f, serializedTransaction, serializedContextFreeData, pushTransactionArgs, availableKeys, result;
var info, abis, _e, serializedTransaction, serializedContextFreeData, pushTransactionArgs, availableKeys, result;
var _f;
return __generator(this, function (_g) {

@@ -403,0 +405,0 @@ switch (_g.label) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sha256 = exports.generateKeyPair = exports.constructElliptic = void 0;
exports.sha256 = exports.generateKeyPair = exports.constructElliptic = exports.Signature = exports.PublicKey = exports.PrivateKey = void 0;
var elliptic_1 = require("elliptic");

@@ -16,3 +16,3 @@ var hash = require("hash.js");

/** Construct the elliptic curve object based on key type */
exports.constructElliptic = function (type) {
var constructElliptic = function (type) {
if (type === eosjs_numeric_1.KeyType.k1) {

@@ -23,3 +23,4 @@ return new elliptic_1.ec('secp256k1');

};
exports.generateKeyPair = function (type, options) {
exports.constructElliptic = constructElliptic;
var generateKeyPair = function (type, options) {
if (options === void 0) { options = {}; }

@@ -44,5 +45,7 @@ if (!options.secureEnv) {

};
exports.sha256 = function (data) {
exports.generateKeyPair = generateKeyPair;
var sha256 = function (data) {
return hash.sha256().update(data).digest();
};
exports.sha256 = sha256;
//# sourceMappingURL=eosjs-key-conversions.js.map

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

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -62,7 +63,8 @@ var __values = (this && this.__values) || function(o) {

/** Is `bignum` a negative number? */
exports.isNegative = function (bignum) {
var isNegative = function (bignum) {
return (bignum[bignum.length - 1] & 0x80) !== 0;
};
exports.isNegative = isNegative;
/** Negate `bignum` */
exports.negate = function (bignum) {
var negate = function (bignum) {
var carry = 1;

@@ -75,2 +77,3 @@ for (var i = 0; i < bignum.length; ++i) {

};
exports.negate = negate;
/**

@@ -81,3 +84,3 @@ * Convert an unsigned decimal number in `s` to a bignum

*/
exports.decimalToBinary = function (size, s) {
var decimalToBinary = function (size, s) {
var result = new Uint8Array(size);

@@ -101,2 +104,3 @@ for (var i = 0; i < s.length; ++i) {

};
exports.decimalToBinary = decimalToBinary;
/**

@@ -107,3 +111,3 @@ * Convert a signed decimal number in `s` to a bignum

*/
exports.signedDecimalToBinary = function (size, s) {
var signedDecimalToBinary = function (size, s) {
var negative = s[0] === '-';

@@ -125,2 +129,3 @@ if (negative) {

};
exports.signedDecimalToBinary = signedDecimalToBinary;
/**

@@ -131,3 +136,3 @@ * Convert `bignum` to an unsigned decimal number

*/
exports.binaryToDecimal = function (bignum, minDigits) {
var binaryToDecimal = function (bignum, minDigits) {
if (minDigits === void 0) { minDigits = 1; }

@@ -148,4 +153,5 @@ var result = Array(minDigits).fill('0'.charCodeAt(0));

result.reverse();
return String.fromCharCode.apply(String, __spread(result));
return String.fromCharCode.apply(String, __spreadArray([], __read(result)));
};
exports.binaryToDecimal = binaryToDecimal;
/**

@@ -156,3 +162,3 @@ * Convert `bignum` to a signed decimal number

*/
exports.signedBinaryToDecimal = function (bignum, minDigits) {
var signedBinaryToDecimal = function (bignum, minDigits) {
if (minDigits === void 0) { minDigits = 1; }

@@ -166,2 +172,3 @@ if (exports.isNegative(bignum)) {

};
exports.signedBinaryToDecimal = signedBinaryToDecimal;
var base58ToBinaryVarSize = function (s) {

@@ -210,3 +217,3 @@ var e_1, _a;

*/
exports.base58ToBinary = function (size, s) {
var base58ToBinary = function (size, s) {
if (!size) {

@@ -233,2 +240,3 @@ return base58ToBinaryVarSize(s);

};
exports.base58ToBinary = base58ToBinary;
/**

@@ -239,3 +247,3 @@ * Convert `bignum` to a base-58 number

*/
exports.binaryToBase58 = function (bignum, minDigits) {
var binaryToBase58 = function (bignum, minDigits) {
var e_2, _a, e_3, _b;

@@ -285,6 +293,7 @@ if (minDigits === void 0) { minDigits = 1; }

result.reverse();
return String.fromCharCode.apply(String, __spread(result));
return String.fromCharCode.apply(String, __spreadArray([], __read(result)));
};
exports.binaryToBase58 = binaryToBase58;
/** Convert an unsigned base-64 number in `s` to a bignum */
exports.base64ToBinary = function (s) {
var base64ToBinary = function (s) {
var len = s.length;

@@ -323,2 +332,3 @@ if ((len & 3) === 1 && s[len - 1] === '=') {

};
exports.base64ToBinary = base64ToBinary;
/** Key types this library supports */

@@ -369,3 +379,3 @@ var KeyType;

/** Convert key in `s` to binary form */
exports.stringToPublicKey = function (s) {
var stringToPublicKey = function (s) {
if (typeof s !== 'string') {

@@ -400,4 +410,5 @@ throw new Error('expected string containing public key');

};
exports.stringToPublicKey = stringToPublicKey;
/** Convert public `key` to legacy string (base-58) form */
exports.publicKeyToLegacyString = function (key) {
var publicKeyToLegacyString = function (key) {
if (key.type === KeyType.k1 && key.data.length === exports.publicKeyDataSize) {

@@ -413,4 +424,5 @@ return keyToString(key, '', 'EOS');

};
exports.publicKeyToLegacyString = publicKeyToLegacyString;
/** Convert `key` to string (base-58) form */
exports.publicKeyToString = function (key) {
var publicKeyToString = function (key) {
if (key.type === KeyType.k1 && key.data.length === exports.publicKeyDataSize) {

@@ -429,6 +441,7 @@ return keyToString(key, 'K1', 'PUB_K1_');

};
exports.publicKeyToString = publicKeyToString;
/** If a key is in the legacy format (`EOS` prefix), then convert it to the new format (`PUB_K1_`).
* Leaves other formats untouched
*/
exports.convertLegacyPublicKey = function (s) {
var convertLegacyPublicKey = function (s) {
if (s.substr(0, 3) === 'EOS') {

@@ -439,10 +452,12 @@ return exports.publicKeyToString(exports.stringToPublicKey(s));

};
exports.convertLegacyPublicKey = convertLegacyPublicKey;
/** If a key is in the legacy format (`EOS` prefix), then convert it to the new format (`PUB_K1_`).
* Leaves other formats untouched
*/
exports.convertLegacyPublicKeys = function (keys) {
var convertLegacyPublicKeys = function (keys) {
return keys.map(exports.convertLegacyPublicKey);
};
exports.convertLegacyPublicKeys = convertLegacyPublicKeys;
/** Convert key in `s` to binary form */
exports.stringToPrivateKey = function (s) {
var stringToPrivateKey = function (s) {
if (typeof s !== 'string') {

@@ -472,4 +487,5 @@ throw new Error('expected string containing private key');

};
exports.stringToPrivateKey = stringToPrivateKey;
/** Convert private `key` to legacy string (base-58) form */
exports.privateKeyToLegacyString = function (key) {
var privateKeyToLegacyString = function (key) {
if (key.type === KeyType.k1 && key.data.length === exports.privateKeyDataSize) {

@@ -496,4 +512,5 @@ var whole_1 = [];

};
exports.privateKeyToLegacyString = privateKeyToLegacyString;
/** Convert `key` to string (base-58) form */
exports.privateKeyToString = function (key) {
var privateKeyToString = function (key) {
if (key.type === KeyType.r1) {

@@ -509,4 +526,5 @@ return keyToString(key, 'R1', 'PVT_R1_');

};
exports.privateKeyToString = privateKeyToString;
/** Convert key in `s` to binary form */
exports.stringToSignature = function (s) {
var stringToSignature = function (s) {
if (typeof s !== 'string') {

@@ -528,4 +546,5 @@ throw new Error('expected string containing signature');

};
exports.stringToSignature = stringToSignature;
/** Convert `signature` to string (base-58) form */
exports.signatureToString = function (signature) {
var signatureToString = function (signature) {
if (signature.type === KeyType.k1) {

@@ -544,2 +563,3 @@ return keyToString(signature, 'K1', 'SIG_K1_');

};
exports.signatureToString = signatureToString;
//# sourceMappingURL=eosjs-numeric.js.map

@@ -10,6 +10,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -16,0 +18,0 @@ function __() { this.constructor = d; }

@@ -49,3 +49,3 @@ /**

value: any;
} | {};
} | Record<string, unknown>;
/** A type in an abi */

@@ -52,0 +52,0 @@ export interface Type {

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

};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};

@@ -330,3 +331,3 @@ var __values = (this && this.__values) || function(o) {

var a = [];
a.push.apply(a, __spread(this.textEncoder.encode(name)));
a.push.apply(a, __spreadArray([], __read(this.textEncoder.encode(name))));
while (a.length < 8) {

@@ -356,3 +357,3 @@ a.push(0);

var a = [precision & 0xff];
a.push.apply(a, __spread(this.textEncoder.encode(name)));
a.push.apply(a, __spreadArray([], __read(this.textEncoder.encode(name))));
while (a.length < 8) {

@@ -479,5 +480,6 @@ a.push(0);

/** Is this a supported ABI version? */
exports.supportedAbiVersion = function (version) {
var supportedAbiVersion = function (version) {
return version.startsWith('eosio::abi/1.');
};
exports.supportedAbiVersion = supportedAbiVersion;
var checkDateParse = function (date) {

@@ -491,30 +493,36 @@ var result = Date.parse(date);

/** Convert date in ISO format to `time_point` (miliseconds since epoch) */
exports.dateToTimePoint = function (date) {
var dateToTimePoint = function (date) {
return Math.round(checkDateParse(date + 'Z') * 1000);
};
exports.dateToTimePoint = dateToTimePoint;
/** Convert `time_point` (miliseconds since epoch) to date in ISO format */
exports.timePointToDate = function (us) {
var timePointToDate = function (us) {
var s = (new Date(us / 1000)).toISOString();
return s.substr(0, s.length - 1);
};
exports.timePointToDate = timePointToDate;
/** Convert date in ISO format to `time_point_sec` (seconds since epoch) */
exports.dateToTimePointSec = function (date) {
var dateToTimePointSec = function (date) {
return Math.round(checkDateParse(date + 'Z') / 1000);
};
exports.dateToTimePointSec = dateToTimePointSec;
/** Convert `time_point_sec` (seconds since epoch) to to date in ISO format */
exports.timePointSecToDate = function (sec) {
var timePointSecToDate = function (sec) {
var s = (new Date(sec * 1000)).toISOString();
return s.substr(0, s.length - 1);
};
exports.timePointSecToDate = timePointSecToDate;
/** Convert date in ISO format to `block_timestamp_type` (half-seconds since a different epoch) */
exports.dateToBlockTimestamp = function (date) {
var dateToBlockTimestamp = function (date) {
return Math.round((checkDateParse(date + 'Z') - 946684800000) / 500);
};
exports.dateToBlockTimestamp = dateToBlockTimestamp;
/** Convert `block_timestamp_type` (half-seconds since a different epoch) to to date in ISO format */
exports.blockTimestampToDate = function (slot) {
var blockTimestampToDate = function (slot) {
var s = (new Date(slot * 500 + 946684800000)).toISOString();
return s.substr(0, s.length - 1);
};
exports.blockTimestampToDate = blockTimestampToDate;
/** Convert `string` to `Symbol`. format: `precision,NAME`. */
exports.stringToSymbol = function (s) {
var stringToSymbol = function (s) {
if (typeof s !== 'string') {

@@ -529,9 +537,11 @@ throw new Error('Expected string containing symbol');

};
exports.stringToSymbol = stringToSymbol;
/** Convert `Symbol` to `string`. format: `precision,NAME`. */
exports.symbolToString = function (_a) {
var symbolToString = function (_a) {
var name = _a.name, precision = _a.precision;
return precision + ',' + name;
};
exports.symbolToString = symbolToString;
/** Convert binary data to hex */
exports.arrayToHex = function (data) {
var arrayToHex = function (data) {
var e_1, _a;

@@ -554,4 +564,5 @@ var result = '';

};
exports.arrayToHex = arrayToHex;
/** Convert hex to binary data */
exports.hexToUint8Array = function (hex) {
var hexToUint8Array = function (hex) {
if (typeof hex !== 'string') {

@@ -574,2 +585,3 @@ throw new Error('Expected string containing hex digits');

};
exports.hexToUint8Array = hexToUint8Array;
function serializeUnknown(buffer, data) {

@@ -761,3 +773,3 @@ throw new Error('Don\'t know how to serialize ' + this.name);

/** Create the set of types built-in to the abi format */
exports.createInitialTypes = function () {
var createInitialTypes = function () {
var result = new Map(Object.entries({

@@ -957,3 +969,4 @@ bool: createType({

}; // createInitialTypes()
exports.createAbiTypes = function () {
exports.createInitialTypes = createInitialTypes;
var createAbiTypes = function () {
var initialTypes = exports.createInitialTypes();

@@ -1136,4 +1149,5 @@ initialTypes.set('extensions_entry', createType({

};
exports.createAbiTypes = createAbiTypes;
/** Get type from `types` */
exports.getType = function (types, name) {
var getType = function (types, name) {
var type = types.get(name);

@@ -1172,2 +1186,3 @@ if (type && type.aliasOfName) {

};
exports.getType = getType;
/**

@@ -1179,3 +1194,3 @@ * Get types from abi

*/
exports.getTypesFromAbi = function (initialTypes, abi) {
var getTypesFromAbi = function (initialTypes, abi) {
var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;

@@ -1272,2 +1287,3 @@ var types = new Map(initialTypes);

}; // getTypesFromAbi
exports.getTypesFromAbi = getTypesFromAbi;
var reverseHex = function (h) {

@@ -1277,3 +1293,3 @@ return h.substr(6, 2) + h.substr(4, 2) + h.substr(2, 2) + h.substr(0, 2);

/** TAPoS: Return transaction fields which reference `refBlock` and expire `expireSeconds` after `timestamp` */
exports.transactionHeader = function (refBlock, expireSeconds) {
var transactionHeader = function (refBlock, expireSeconds) {
var timestamp = refBlock.header ? refBlock.header.timestamp : refBlock.timestamp;

@@ -1287,4 +1303,5 @@ var prefix = parseInt(reverseHex(refBlock.id.substr(16, 8)), 16);

};
exports.transactionHeader = transactionHeader;
/** Convert action data to serialized form (hex) */
exports.serializeActionData = function (contract, account, name, data, textEncoder, textDecoder) {
var serializeActionData = function (contract, account, name, data, textEncoder, textDecoder) {
var action = contract.actions.get(name);

@@ -1298,4 +1315,5 @@ if (!action) {

};
exports.serializeActionData = serializeActionData;
/** Return action in serialized form */
exports.serializeAction = function (contract, account, name, authorization, data, textEncoder, textDecoder) {
var serializeAction = function (contract, account, name, authorization, data, textEncoder, textDecoder) {
return {

@@ -1308,4 +1326,5 @@ account: account,

};
exports.serializeAction = serializeAction;
/** Deserialize action data. If `data` is a `string`, then it's assumed to be in hex. */
exports.deserializeActionData = function (contract, account, name, data, textEncoder, textDecoder) {
var deserializeActionData = function (contract, account, name, data, textEncoder, textDecoder) {
var action = contract.actions.get(name);

@@ -1322,4 +1341,5 @@ if (typeof data === 'string') {

};
exports.deserializeActionData = deserializeActionData;
/** Deserialize action. If `data` is a `string`, then it's assumed to be in hex. */
exports.deserializeAction = function (contract, account, name, authorization, data, textEncoder, textDecoder) {
var deserializeAction = function (contract, account, name, authorization, data, textEncoder, textDecoder) {
return {

@@ -1332,3 +1352,4 @@ account: account,

};
exports.serializeAnyvar = function (buffer, anyvar) {
exports.deserializeAction = deserializeAction;
var serializeAnyvar = function (buffer, anyvar) {
var _a, _b, _c, _d, _e, _f, _g;

@@ -1361,3 +1382,4 @@ var def;

};
exports.deserializeAnyvar = function (buffer, state) {
exports.serializeAnyvar = serializeAnyvar;
var deserializeAnyvar = function (buffer, state) {
var defIndex = buffer.getVaruint32();

@@ -1376,6 +1398,8 @@ if (defIndex >= anyvarDefsByIndex.length) {

};
exports.deserializeAnyvarShort = function (buffer) {
exports.deserializeAnyvar = deserializeAnyvar;
var deserializeAnyvarShort = function (buffer) {
return exports.deserializeAnyvar(buffer, new SerializerState({ useShortForm: true }));
};
exports.serializeAnyObject = function (buffer, obj) {
exports.deserializeAnyvarShort = deserializeAnyvarShort;
var serializeAnyObject = function (buffer, obj) {
var e_11, _a;

@@ -1399,3 +1423,4 @@ var entries = Object.entries(obj);

};
exports.deserializeAnyObject = function (buffer, state) {
exports.serializeAnyObject = serializeAnyObject;
var deserializeAnyObject = function (buffer, state) {
var len = buffer.getVaruint32();

@@ -1416,3 +1441,4 @@ var result = {};

};
exports.serializeAnyArray = function (buffer, arr) {
exports.deserializeAnyObject = deserializeAnyObject;
var serializeAnyArray = function (buffer, arr) {
var e_12, _a;

@@ -1434,3 +1460,4 @@ buffer.pushVaruint32(arr.length);

};
exports.deserializeAnyArray = function (buffer, state) {
exports.serializeAnyArray = serializeAnyArray;
var deserializeAnyArray = function (buffer, state) {
var len = buffer.getVaruint32();

@@ -1443,2 +1470,3 @@ var result = [];

};
exports.deserializeAnyArray = deserializeAnyArray;
var addAdditionalTypes = function () {

@@ -1506,3 +1534,3 @@ var initialTypes = exports.createInitialTypes();

];
exports.serializeQuery = function (buffer, query) {
var serializeQuery = function (buffer, query) {
var _a, _b, _c, e_13, _d;

@@ -1552,2 +1580,3 @@ var method;

};
exports.serializeQuery = serializeQuery;
//# sourceMappingURL=eosjs-serialize.js.map
{
"name": "eosjs",
"version": "22.0.0-rc2",
"version": "22.0.0",
"description": "Talk to eos API",

@@ -30,4 +30,4 @@ "main": "dist/index.js",

"dependencies": {
"bn.js": "5.1.3",
"elliptic": "6.5.3",
"bn.js": "5.2.0",
"elliptic": "6.5.4",
"hash.js": "1.1.7",

@@ -37,12 +37,14 @@ "pako": "2.0.3"

"devDependencies": {
"@blockone/eslint-config-blockone": "^3.0.0",
"@blockone/eslint-config-blockone": "^4.0.1",
"@types/elliptic": "^6.4.12",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.28",
"@types/node-fetch": "^2.5.8",
"@types/jest": "^26.0.23",
"@types/node": "^14.17.0",
"@types/node-fetch": "^2.5.10",
"@types/pako": "^1.0.1",
"buffer": "^6.0.3",
"clean-webpack-plugin": "^3.0.0",
"cypress": "^6.5.0",
"crypto-browserify": "^3.12.0",
"cypress": "^7.3.0",
"eosjs-ecc": "^4.0.7",
"eslint": "^6.8.0",
"eslint": "^7.26.0",
"jest": "^26.6.3",

@@ -52,7 +54,7 @@ "jest-extended": "^0.11.5",

"rimraf": "^3.0.2",
"ts-jest": "^26.5.1",
"ts-loader": "^8.0.17",
"typescript": "^3.9.9",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12"
"ts-jest": "^26.5.6",
"ts-loader": "^9.2.1",
"typescript": "^4.2.4",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0"
},

@@ -77,3 +79,3 @@ "jest": {

"ts-jest": {
"tsConfig": "tsconfig.json"
"tsconfig": "tsconfig.json"
}

@@ -80,0 +82,0 @@ },

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

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