Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waves/ts-lib-crypto

Package Overview
Dependencies
Maintainers
13
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/ts-lib-crypto - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4-beta.1

28

bytes.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.concat = exports.split = exports.merkleVerify = exports.rsaVerify = exports.rsaSign = exports.rsaKeyPairSync = exports.rsaKeyPair = exports.decryptSeed = exports.encryptSeed = exports.aesEncrypt = exports.aesDecrypt = exports.messageEncrypt = exports.messageDecrypt = exports.verifyAddress = exports.verifyPublicKey = exports.verifySignature = exports.randomBytes = exports.randomSeed = exports.random = exports.bytesToString = exports.stringToBytes = exports.base16Decode = exports.base16Encode = exports.base58Decode = exports.base58Encode = exports.base64Decode = exports.base64Encode = exports.seedWithNonce = exports.sharedKey = exports.sha256 = exports.keccak = exports.blake2b = exports.address = exports.privateKey = exports.publicKey = exports.buildAddress = exports.keyPair = exports.signBytes = void 0;
var crypto_1 = require("./crypto/crypto");
var seed_words_list_1 = require("./crypto/seed-words-list");
exports.seedWordsList = seed_words_list_1.seedWordsList;
Object.defineProperty(exports, "seedWordsList", { enumerable: true, get: function () { return seed_words_list_1.seedWordsList; } });
var chain_id_1 = require("./extensions/chain-id");
exports.ChaidId = chain_id_1.ChaidId;
Object.defineProperty(exports, "ChaidId", { enumerable: true, get: function () { return chain_id_1.ChaidId; } });
var seed_1 = require("./extensions/seed");
exports.Seed = seed_1.Seed;
Object.defineProperty(exports, "Seed", { enumerable: true, get: function () { return seed_1.Seed; } });
var util_1 = require("./crypto/util");
exports.isPrivateKey = util_1.isPrivateKey;
exports.isPublicKey = util_1.isPublicKey;
Object.defineProperty(exports, "isPrivateKey", { enumerable: true, get: function () { return util_1.isPrivateKey; } });
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return util_1.isPublicKey; } });
var crypto_2 = require("./crypto/crypto");
exports.crypto = crypto_2.crypto;
__export(require("./crypto/interface"));
Object.defineProperty(exports, "crypto", { enumerable: true, get: function () { return crypto_2.crypto; } });
__exportStar(require("./crypto/interface"), exports);
exports.signBytes = (_a = crypto_1.crypto({ output: 'Bytes' }), _a.signBytes), exports.keyPair = _a.keyPair, exports.buildAddress = _a.buildAddress, exports.publicKey = _a.publicKey, exports.privateKey = _a.privateKey, exports.address = _a.address, exports.blake2b = _a.blake2b, exports.keccak = _a.keccak, exports.sha256 = _a.sha256, exports.sharedKey = _a.sharedKey, exports.seedWithNonce = _a.seedWithNonce, exports.base64Encode = _a.base64Encode, exports.base64Decode = _a.base64Decode, exports.base58Encode = _a.base58Encode, exports.base58Decode = _a.base58Decode, exports.base16Encode = _a.base16Encode, exports.base16Decode = _a.base16Decode, exports.stringToBytes = _a.stringToBytes, exports.bytesToString = _a.bytesToString, exports.random = _a.random, exports.randomSeed = _a.randomSeed, exports.randomBytes = _a.randomBytes, exports.verifySignature = _a.verifySignature, exports.verifyPublicKey = _a.verifyPublicKey, exports.verifyAddress = _a.verifyAddress, exports.messageDecrypt = _a.messageDecrypt, exports.messageEncrypt = _a.messageEncrypt, exports.aesDecrypt = _a.aesDecrypt, exports.aesEncrypt = _a.aesEncrypt, exports.encryptSeed = _a.encryptSeed, exports.decryptSeed = _a.decryptSeed, exports.rsaKeyPair = _a.rsaKeyPair, exports.rsaKeyPairSync = _a.rsaKeyPairSync, exports.rsaSign = _a.rsaSign, exports.rsaVerify = _a.rsaVerify, exports.merkleVerify = _a.merkleVerify, exports.split = _a.split, exports.concat = _a.concat;
//# sourceMappingURL=bytes.js.map

@@ -1,7 +0,7 @@

import { TBinaryIn } from '../crypto/interface';
export declare const base64Decode: (input: string) => Uint8Array;
export declare const base64Encode: (input: TBinaryIn) => string;
export declare const base58Decode: (input: string) => Uint8Array;
export declare const base58Encode: (input: TBinaryIn) => string;
export declare const base16Decode: (input: string) => Uint8Array;
export declare const base16Encode: (input: TBinaryIn) => string;
import { TBase64, TBytes, TBinaryIn, TBase58, TBase16 } from '../crypto/interface';
export declare const base64Decode: (input: TBase64) => TBytes;
export declare const base64Encode: (input: TBinaryIn) => TBase64;
export declare const base58Decode: (input: TBase58) => TBytes;
export declare const base58Encode: (input: TBinaryIn) => TBase58;
export declare const base16Decode: (input: TBase16) => TBytes;
export declare const base16Encode: (input: TBinaryIn) => TBase16;

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.base16Encode = exports.base16Decode = exports.base58Encode = exports.base58Decode = exports.base64Encode = exports.base64Decode = void 0;
//@ts-ignore

@@ -8,0 +9,0 @@ var util_1 = require("node-forge/lib/util");

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

import { TBinaryIn, TRawStringIn } from '../crypto/interface';
export declare const _fromIn: (inValue: TBinaryIn) => Uint8Array;
export declare const _fromRawIn: (inValue: TRawStringIn) => Uint8Array;
import { TBinaryIn, TBytes, TRawStringIn } from '../crypto/interface';
export declare const _fromIn: (inValue: TBinaryIn) => TBytes;
export declare const _fromRawIn: (inValue: TRawStringIn) => TBytes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._fromRawIn = exports._fromIn = void 0;
var base_xx_1 = require("./base-xx");

@@ -4,0 +5,0 @@ var string_bytes_1 = require("./string-bytes");

@@ -1,8 +0,8 @@

import { TBinaryIn } from '../crypto/interface';
export declare const stringToBytes: (str: string, encoding?: "utf8" | "raw") => Uint8Array;
export declare const bytesToString: (bytes: TBinaryIn, encoding?: "utf8" | "raw") => string;
import { TBytes, TBinaryIn } from '../crypto/interface';
export declare const stringToBytes: (str: string, encoding?: 'utf8' | 'raw') => TBytes;
export declare const bytesToString: (bytes: TBinaryIn, encoding?: 'utf8' | 'raw') => string;
/**
* Converts each character to byte
*/
export declare const binaryStringToBytes: (str: string) => Uint8Array;
export declare const binaryStringToBytes: (str: string) => TBytes;
/**

@@ -9,0 +9,0 @@ * Reads each byte as individual character

@@ -23,2 +23,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.bytesToBinaryString = exports.binaryStringToBytes = exports.bytesToString = exports.stringToBytes = void 0;
var param_1 = require("./param");

@@ -25,0 +26,0 @@ var Utf8_1 = require("../libs/Utf8");

@@ -1,7 +0,7 @@

import { TSeed, INonceSeed, TPublicKey, TBinaryIn, TKeyPair, TPrivateKey } from './interface';
import { TSeed, INonceSeed, TBytes, TChainId, TPublicKey, TBinaryIn, TKeyPair, TPrivateKey } from './interface';
export declare const seedWithNonce: (seed: TSeed, nonce: number) => INonceSeed;
export declare const buildAddress: (publicKeyBytes: Uint8Array, chainId?: string | number) => Uint8Array;
export declare const keyPair: (seed: TSeed) => TKeyPair<Uint8Array>;
export declare const address: (seedOrPublicKey: string | Uint8Array | number[] | import("./interface").TRawStringInDiscriminator | INonceSeed | TPublicKey<TBinaryIn>, chainId?: string | number) => Uint8Array;
export declare const publicKey: (seedOrPrivateKey: string | Uint8Array | number[] | import("./interface").TRawStringInDiscriminator | INonceSeed | TPrivateKey<TBinaryIn>) => Uint8Array;
export declare const privateKey: (seed: TSeed) => Uint8Array;
export declare const buildAddress: (publicKeyBytes: TBytes, chainId?: TChainId) => TBytes;
export declare const keyPair: (seed: TSeed) => TKeyPair<TBytes>;
export declare const address: (seedOrPublicKey: TSeed | TPublicKey<TBinaryIn>, chainId?: TChainId) => TBytes;
export declare const publicKey: (seedOrPrivateKey: TSeed | TPrivateKey<TBinaryIn>) => TBytes;
export declare const privateKey: (seed: TSeed) => TBytes;

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.privateKey = exports.publicKey = exports.address = exports.keyPair = exports.buildAddress = exports.seedWithNonce = void 0;
var interface_1 = require("./interface");

@@ -8,0 +9,0 @@ var seed_1 = require("../extensions/seed");

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

import { TBinaryIn } from './interface';
export declare const concat: (...arrays: TBinaryIn[]) => Uint8Array;
export declare const split: (binary: TBinaryIn, ...sizes: number[]) => Uint8Array[];
import { TBinaryIn, TBytes } from './interface';
export declare const concat: (...arrays: TBinaryIn[]) => TBytes;
export declare const split: (binary: TBinaryIn, ...sizes: number[]) => TBytes[];

@@ -23,2 +23,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.split = exports.concat = void 0;
var param_1 = require("../conversions/param");

@@ -25,0 +26,0 @@ exports.concat = function () {

@@ -34,2 +34,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.crypto = void 0;
var random_1 = require("./random");

@@ -86,3 +87,3 @@ var encryption_1 = require("./encryption");

};
return __assign({}, seedPart, { sharedKey: toOut(encryption_1.sharedKey), buildAddress: address_keys_seed_1.buildAddress,
return __assign(__assign({}, seedPart), { sharedKey: toOut(encryption_1.sharedKey), buildAddress: address_keys_seed_1.buildAddress,
blake2b: hashing_1.blake2b,

@@ -89,0 +90,0 @@ keccak: hashing_1.keccak,

@@ -1,6 +0,6 @@

import { TBinaryIn, TRawStringIn, AESMode } from './interface';
export declare const aesEncrypt: (data: TBinaryIn, key: TBinaryIn, mode?: AESMode, iv?: string | Uint8Array | number[] | undefined) => Uint8Array;
export declare const aesDecrypt: (encryptedData: TBinaryIn, key: TBinaryIn, mode?: AESMode, iv?: string | Uint8Array | number[] | undefined) => Uint8Array;
export declare const messageEncrypt: (sharedKey: TBinaryIn, message: string) => Uint8Array;
import { TBinaryIn, TRawStringIn, TBytes, AESMode } from './interface';
export declare const aesEncrypt: (data: TBinaryIn, key: TBinaryIn, mode?: AESMode, iv?: string | Uint8Array | number[] | undefined) => TBytes;
export declare const aesDecrypt: (encryptedData: TBinaryIn, key: TBinaryIn, mode?: AESMode, iv?: string | Uint8Array | number[] | undefined) => TBytes;
export declare const messageEncrypt: (sharedKey: TBinaryIn, message: string) => TBytes;
export declare const messageDecrypt: (sharedKey: TBinaryIn, encryptedMessage: TBinaryIn) => string;
export declare const sharedKey: (privateKeyFrom: TBinaryIn, publicKeyTo: TBinaryIn, prefix: TRawStringIn) => Uint8Array;
export declare const sharedKey: (privateKeyFrom: TBinaryIn, publicKeyTo: TBinaryIn, prefix: TRawStringIn) => TBytes;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __read = (this && this.__read) || function (o, n) {

@@ -18,9 +37,2 @@ var m = typeof Symbol === "function" && o[Symbol.iterator];

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -30,2 +42,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.sharedKey = exports.messageDecrypt = exports.messageEncrypt = exports.aesDecrypt = exports.aesEncrypt = void 0;
// @ts-ignore

@@ -32,0 +45,0 @@ var forgeCipher = __importStar(require("node-forge/lib/cipher"));

@@ -1,7 +0,7 @@

import { TBinaryIn } from './interface';
import { TBinaryIn, TBytes } from './interface';
import 'node-forge/lib/sha256';
export declare const _hashChain: (input: TBinaryIn) => Uint8Array;
export declare const sha256: (input: TBinaryIn) => Uint8Array;
export declare const blake2b: (input: TBinaryIn) => Uint8Array;
export declare const keccak: (input: TBinaryIn) => Uint8Array;
export declare const hmacSHA256: (message: TBinaryIn, key: TBinaryIn) => Uint8Array;
export declare const _hashChain: (input: TBinaryIn) => TBytes;
export declare const sha256: (input: TBinaryIn) => TBytes;
export declare const blake2b: (input: TBinaryIn) => TBytes;
export declare const keccak: (input: TBinaryIn) => TBytes;
export declare const hmacSHA256: (message: TBinaryIn, key: TBinaryIn) => TBytes;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.hmacSHA256 = exports.keccak = exports.blake2b = exports.sha256 = exports._hashChain = void 0;
var param_1 = require("../conversions/param");

@@ -11,0 +24,0 @@ var sha3_1 = require("../libs/sha3");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TEST_NET_CHAIN_ID = exports.MAIN_NET_CHAIN_ID = exports.ADDRESS_LENGTH = exports.SIGNATURE_LENGTH = exports.PRIVATE_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = void 0;
exports.PUBLIC_KEY_LENGTH = 32;

@@ -4,0 +5,0 @@ exports.PRIVATE_KEY_LENGTH = 32;

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.merkleVerify = void 0;
var hashing_1 = require("./hashing");

@@ -21,0 +22,0 @@ var concat_split_1 = require("./concat-split");

@@ -1,4 +0,4 @@

import { TRandomTypesMap } from './interface';
import { TBytes, TRandomTypesMap } from './interface';
export declare const random: <T extends "Array8" | "Array16" | "Array32" | "Buffer" | "Uint8Array" | "Uint16Array" | "Uint32Array">(count: number, type: T) => TRandomTypesMap[T];
export declare const randomBytes: (length: number) => Uint8Array;
export declare const randomBytes: (length: number) => TBytes;
export declare const randomSeed: (wordsCount?: number) => string;

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.randomSeed = exports.randomBytes = exports.random = void 0;
// @ts-ignore

@@ -8,0 +9,0 @@ var random_1 = __importDefault(require("node-forge/lib/random"));

@@ -1,7 +0,12 @@

import { RSADigestAlgorithm, TRSAKeyPair } from './interface';
import { RSADigestAlgorithm, TBytes, TRSAKeyPair } from './interface';
export declare const pemToBytes: (pem: string) => Uint8Array;
export declare const bytesToPem: (bytes: Uint8Array, type: "rsaPrivateNonEncrypted" | "rsaPublic") => string;
declare const pemTypeMap: {
rsaPrivateNonEncrypted: string;
rsaPublic: string;
};
export declare const bytesToPem: (bytes: Uint8Array, type: keyof typeof pemTypeMap) => string;
export declare const rsaKeyPairSync: (bits?: number | undefined, e?: number | undefined) => TRSAKeyPair;
export declare const rsaKeyPair: (bits?: number | undefined, e?: number | undefined) => Promise<TRSAKeyPair>;
export declare const rsaSign: (rsaPrivateKey: Uint8Array, message: Uint8Array, digest?: RSADigestAlgorithm) => Uint8Array;
export declare const rsaVerify: (rsaPublicKey: Uint8Array, message: Uint8Array, signature: Uint8Array, digest?: RSADigestAlgorithm) => boolean;
export declare const rsaSign: (rsaPrivateKey: TBytes, message: TBytes, digest?: RSADigestAlgorithm) => TBytes;
export declare const rsaVerify: (rsaPublicKey: TBytes, message: TBytes, signature: TBytes, digest?: RSADigestAlgorithm) => boolean;
export {};
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -37,11 +57,4 @@ });

};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
exports.rsaVerify = exports.rsaSign = exports.rsaKeyPair = exports.rsaKeyPairSync = exports.bytesToPem = exports.pemToBytes = void 0;
// @ts-ignore

@@ -98,3 +111,3 @@ var pki = __importStar(require("node-forge/lib/pki"));

};
exports.rsaKeyPair = function (bits, e) { return __awaiter(_this, void 0, void 0, function () {
exports.rsaKeyPair = function (bits, e) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {

@@ -101,0 +114,0 @@ return [2 /*return*/, new Promise(function (resolve, reject) {

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

import { TBase64 } from './interface';
/**

@@ -8,3 +9,3 @@ * Encrypts arbitrary utf8 string with utf8 password. Evp key deriving function is used to get encryption key and IV from

*/
export declare const encryptSeed: (seed: string, password: string, encryptionRounds?: number | undefined) => string;
export declare const decryptSeed: (encryptedSeed: string, password: string, encryptionRounds?: number | undefined) => string;
export declare const encryptSeed: (seed: string, password: string, encryptionRounds?: number | undefined) => TBase64;
export declare const decryptSeed: (encryptedSeed: TBase64, password: string, encryptionRounds?: number | undefined) => string;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.decryptSeed = exports.encryptSeed = void 0;
var string_bytes_1 = require("../conversions/string-bytes");

@@ -11,0 +24,0 @@ // @ts-ignore

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.seedWordsList = void 0;
exports.seedWordsList = [

@@ -4,0 +5,0 @@ 'abandon', 'ability', 'able', 'about', 'above', 'absent', 'absorb', 'abstract', 'absurd', 'abuse', 'access',

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

import { TPrivateKey, TBinaryIn } from './interface';
export declare const signBytes: (seedOrPrivateKey: string | Uint8Array | number[] | import("./interface").TRawStringInDiscriminator | import("./interface").INonceSeed | TPrivateKey<TBinaryIn>, bytes: TBinaryIn, random?: string | Uint8Array | number[] | undefined) => Uint8Array;
import { TSeed, TPrivateKey, TBinaryIn, TBytes } from './interface';
export declare const signBytes: (seedOrPrivateKey: TSeed | TPrivateKey<TBinaryIn>, bytes: TBinaryIn, random?: string | Uint8Array | number[] | undefined) => TBytes;

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.signBytes = void 0;
var axlsign_1 = __importDefault(require("../libs/axlsign"));

@@ -8,0 +9,0 @@ var param_1 = require("../conversions/param");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPrivateKey = exports.isPublicKey = void 0;
exports.isPublicKey = function (val) {

@@ -4,0 +5,0 @@ return val.publicKey !== undefined;

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyPublicKey = exports.verifySignature = exports.verifyAddress = void 0;
var interface_1 = require("./interface");

@@ -8,0 +9,0 @@ var chain_id_1 = require("../extensions/chain-id");

@@ -0,5 +1,6 @@

import { TChainId } from '../crypto/interface';
export declare const ChaidId: {
toNumber(chainId: string | number): number;
isMainnet(chainId: string | number): boolean;
isTestnet(chainId: string | number): boolean;
toNumber(chainId: TChainId): number;
isMainnet(chainId: TChainId): boolean;
isTestnet(chainId: TChainId): boolean;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChaidId = void 0;
var interface_1 = require("../crypto/interface");

@@ -4,0 +5,0 @@ var interface_2 = require("../crypto/interface");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Seed = void 0;
var param_1 = require("../conversions/param");

@@ -4,0 +5,0 @@ var string_bytes_1 = require("../conversions/string-bytes");

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.concat = exports.split = exports.merkleVerify = exports.rsaVerify = exports.rsaSign = exports.rsaKeyPairSync = exports.rsaKeyPair = exports.decryptSeed = exports.encryptSeed = exports.aesEncrypt = exports.aesDecrypt = exports.messageEncrypt = exports.messageDecrypt = exports.verifyAddress = exports.verifyPublicKey = exports.verifySignature = exports.randomBytes = exports.randomSeed = exports.random = exports.bytesToString = exports.stringToBytes = exports.base16Decode = exports.base16Encode = exports.base58Decode = exports.base58Encode = exports.base64Decode = exports.base64Encode = exports.seedWithNonce = exports.sharedKey = exports.sha256 = exports.keccak = exports.blake2b = exports.buildAddress = exports.address = exports.privateKey = exports.publicKey = exports.keyPair = exports.signBytes = void 0;
var crypto_1 = require("./crypto/crypto");
var seed_words_list_1 = require("./crypto/seed-words-list");
exports.seedWordsList = seed_words_list_1.seedWordsList;
Object.defineProperty(exports, "seedWordsList", { enumerable: true, get: function () { return seed_words_list_1.seedWordsList; } });
var chain_id_1 = require("./extensions/chain-id");
exports.ChaidId = chain_id_1.ChaidId;
Object.defineProperty(exports, "ChaidId", { enumerable: true, get: function () { return chain_id_1.ChaidId; } });
var seed_1 = require("./extensions/seed");
exports.Seed = seed_1.Seed;
Object.defineProperty(exports, "Seed", { enumerable: true, get: function () { return seed_1.Seed; } });
var util_1 = require("./crypto/util");
exports.isPrivateKey = util_1.isPrivateKey;
exports.isPublicKey = util_1.isPublicKey;
Object.defineProperty(exports, "isPrivateKey", { enumerable: true, get: function () { return util_1.isPrivateKey; } });
Object.defineProperty(exports, "isPublicKey", { enumerable: true, get: function () { return util_1.isPublicKey; } });
var crypto_2 = require("./crypto/crypto");
exports.crypto = crypto_2.crypto;
__export(require("./crypto/interface"));
Object.defineProperty(exports, "crypto", { enumerable: true, get: function () { return crypto_2.crypto; } });
__exportStar(require("./crypto/interface"), exports);
exports.signBytes = (_a = crypto_1.crypto({ output: 'Base58' }), _a.signBytes), exports.keyPair = _a.keyPair, exports.publicKey = _a.publicKey, exports.privateKey = _a.privateKey, exports.address = _a.address, exports.buildAddress = _a.buildAddress, exports.blake2b = _a.blake2b, exports.keccak = _a.keccak, exports.sha256 = _a.sha256, exports.sharedKey = _a.sharedKey, exports.seedWithNonce = _a.seedWithNonce, exports.base64Encode = _a.base64Encode, exports.base64Decode = _a.base64Decode, exports.base58Encode = _a.base58Encode, exports.base58Decode = _a.base58Decode, exports.base16Encode = _a.base16Encode, exports.base16Decode = _a.base16Decode, exports.stringToBytes = _a.stringToBytes, exports.bytesToString = _a.bytesToString, exports.random = _a.random, exports.randomSeed = _a.randomSeed, exports.randomBytes = _a.randomBytes, exports.verifySignature = _a.verifySignature, exports.verifyPublicKey = _a.verifyPublicKey, exports.verifyAddress = _a.verifyAddress, exports.messageDecrypt = _a.messageDecrypt, exports.messageEncrypt = _a.messageEncrypt, exports.aesDecrypt = _a.aesDecrypt, exports.aesEncrypt = _a.aesEncrypt, exports.encryptSeed = _a.encryptSeed, exports.decryptSeed = _a.decryptSeed, exports.rsaKeyPair = _a.rsaKeyPair, exports.rsaKeyPairSync = _a.rsaKeyPairSync, exports.rsaSign = _a.rsaSign, exports.rsaVerify = _a.rsaVerify, exports.merkleVerify = _a.merkleVerify, exports.split = _a.split, exports.concat = _a.concat;
//# sourceMappingURL=index.js.map

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

export declare const utf8ArrayToStr: (array: Uint8Array | number[]) => any;
export declare const utf8ArrayToStr: (array: number[] | Uint8Array) => any;
export declare function strToUtf8Array(str: string): Uint8Array;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.strToUtf8Array = exports.utf8ArrayToStr = void 0;
var Utf8ArrayToStr = (function () {

@@ -22,9 +23,11 @@ var charCache = new Array(128); // Preallocate the cache for the common single byte chars

}
else if (String.fromCodePoint) {
codePt = ((byte1 & 0x07) << 18) | ((array[i++] & 0x3F) << 12) | ((array[i++] & 0x3F) << 6) | (array[i++] & 0x3F);
else { // @ts-ignore
if (String.fromCodePoint) {
codePt = ((byte1 & 0x07) << 18) | ((array[i++] & 0x3F) << 12) | ((array[i++] & 0x3F) << 6) | (array[i++] & 0x3F);
}
else {
codePt = 63; // Cannot convertLongFields four byte code points, so use "?" instead
i += 3;
}
}
else {
codePt = 63; // Cannot convertLongFields four byte code points, so use "?" instead
i += 3;
}
result.push(charCache[codePt] || (charCache[codePt] = charFromCodePt(codePt)));

@@ -31,0 +34,0 @@ }

{
"name": "@waves/ts-lib-crypto",
"version": "1.4.3",
"version": "1.4.4-beta.1",
"description": "This library contains all algorithm implementations like signature verification and protocol entries like address used in Waves.",

@@ -29,4 +29,4 @@ "keywords": [

"js-sha3": "^0.8.0",
"node-forge": "^0.8.5"
"node-forge": "^0.10.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

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 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 not supported yet

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

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