@vechain/sdk-core
Advanced tools
Comparing version 1.0.0-beta.15 to 1.0.0-beta.16
{ | ||
"name": "@vechain/sdk-core", | ||
"version": "1.0.0-beta.15", | ||
"version": "1.0.0-beta.16", | ||
"description": "Includes modules for fundamental operations like hashing and cryptography", | ||
@@ -35,3 +35,4 @@ "author": "vechain Foundation", | ||
"test:integration": "rm -rf ./coverageIntegration && jest --coverage --coverageDirectory=coverageIntegration --group=integration", | ||
"test": "rm -rf ./coverage && jest --coverage --coverageDirectory=coverage --group=integration --group=unit" | ||
"test": "rm -rf ./coverage && jest --coverage --coverageDirectory=coverage --group=integration --group=unit", | ||
"test:browser": "rm -rf ./coverage && jest --coverage --coverageDirectory=coverage --group=integration --group=unit --config ./jest.config.browser.js" | ||
}, | ||
@@ -43,4 +44,4 @@ "dependencies": { | ||
"@types/elliptic": "^6.4.18", | ||
"@vechain/sdk-errors": "1.0.0-beta.15", | ||
"@vechain/sdk-logging": "1.0.0-beta.15", | ||
"@vechain/sdk-errors": "1.0.0-beta.16", | ||
"@vechain/sdk-logging": "1.0.0-beta.16", | ||
"bignumber.js": "^9.1.2", | ||
@@ -47,0 +48,0 @@ "blakejs": "^1.2.1", |
@@ -55,3 +55,2 @@ import { ADDRESS, assert } from '@vechain/sdk-errors'; | ||
*/ | ||
function fromPublicKey(publicKey: Uint8Array): string { | ||
@@ -58,0 +57,0 @@ return toERC55Checksum( |
@@ -40,2 +40,3 @@ import { Hex, Hex0x } from '../utils'; | ||
* @param {string | Uint8Array} data - The input data to be hashed. | ||
* @param {string} returnType - The return type of the hash. It can be 'buffer'. | ||
* | ||
@@ -42,0 +43,0 @@ * @return {Uint8Array} - The Blake2b-256 hash of the given data as a Uint8Array. |
@@ -20,13 +20,2 @@ import { Hex0x } from '../utils'; | ||
/** | ||
* Computes the sha256 hash of the given data. | ||
* Returns the hash as a Uint8Array. | ||
* | ||
* Secure audit function. | ||
* * {@link sha256} | ||
* | ||
* @param data - The input data (either a Uint8Array or string) for which the hash needs to be computed. | ||
* @param returnType - The format in which to return the hash. Either 'buffer' or 'hex'. | ||
* @returns {Uint8Array} A Uint8Array containing the 256-bit sha256 hash of the provided data. | ||
*/ | ||
/** | ||
* Calculates the SHA-256 hash of the given data. | ||
@@ -33,0 +22,0 @@ * |
@@ -8,15 +8,5 @@ import * as bip32 from '@scure/bip32'; | ||
import { sha256 } from '../hash'; | ||
import { VET_DERIVATION_PATH } from '../utils'; | ||
import { VET_DERIVATION_PATH, X_PRIV_PREFIX, X_PUB_PREFIX } from '../utils'; | ||
/** | ||
* Prefix for extended private key | ||
*/ | ||
const X_PRIV_PREFIX = utils.hexToBytes('0488ade4000000000000000000'); | ||
/** | ||
* Prefix for extended public key | ||
*/ | ||
const X_PUB_PREFIX = utils.hexToBytes('0488b21e000000000000000000'); | ||
/** | ||
* Creates a [BIP32 Hierarchical Deterministic Key](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) | ||
@@ -42,3 +32,3 @@ * {@link bip32.HDKey} node | ||
words: string[], | ||
path = VET_DERIVATION_PATH | ||
path: string = VET_DERIVATION_PATH | ||
): bip32.HDKey { | ||
@@ -45,0 +35,0 @@ let master: bip32.HDKey; |
/** | ||
* Keystore Scrypt params | ||
* The [Scrypt](https://en.wikipedia.org/wiki/Scrypt) parameters | ||
* used in the keystore encryption. | ||
* | ||
* @property {number} N - The CPU/memory cost parameter = 2^17 = 131072. | ||
* @property {number} r - The block size parameter = 8. | ||
* @property {number} p - The parallelization parameter = 1. | ||
*/ | ||
@@ -4,0 +9,0 @@ const SCRYPT_PARAMS = { |
@@ -49,3 +49,3 @@ /** | ||
// Stirng version of keystore | ||
// String version of keystore | ||
const keystoreJsonString = await ethers.encryptKeystoreJson( | ||
@@ -52,0 +52,0 @@ keystoreAccount, |
@@ -390,3 +390,3 @@ /** | ||
* **WARNING:** call | ||
* ```javascrypt | ||
* ```javascript | ||
* privateKey.fill(0) | ||
@@ -434,3 +434,3 @@ * ``` | ||
* **WARNING:** call | ||
* ```javascrypt | ||
* ```javascript | ||
* privateKey.fill(0) | ||
@@ -437,0 +437,0 @@ * ``` |
@@ -70,3 +70,3 @@ import { addressUtils } from '../../address'; | ||
assertIsValidTransactionSigningPrivateKey( | ||
'signWithDelgator', | ||
'signWithDelegator', | ||
delegatorPrivateKey, | ||
@@ -73,0 +73,0 @@ secp256k1.isValidPrivateKey, |
import { sign, signWithDelegator, decode } from './handlers'; | ||
/** | ||
* TransactionHandler provides a set of utility functions for signing and decoding | ||
* transactions. | ||
*/ | ||
const TransactionHandler = { | ||
@@ -4,0 +8,0 @@ // Sign transaction |
@@ -14,3 +14,3 @@ import * as utils from '@noble/curves/abstract/utils'; | ||
*/ | ||
const BLOOM_REGEX = /^(0x)?[0-9a-f]{16,}$/i; | ||
const BLOOM_REGEX: RegExp = /^(0x)?[0-9a-f]{16,}$/i; | ||
@@ -17,0 +17,0 @@ /** |
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
const INTEGER_REGEX = /^\d+$/; | ||
const INTEGER_REGEX: RegExp = /^\d+$/; | ||
@@ -18,0 +18,0 @@ /** |
@@ -30,3 +30,3 @@ import * as utils from '@noble/curves/abstract/utils'; | ||
*/ | ||
const REGEX_FOR_0X_PREFIX_HEX = /^0x[0-9a-f]*$/i; | ||
const REGEX_FOR_0X_PREFIX_HEX: RegExp = /^0x[0-9a-f]*$/i; | ||
@@ -39,3 +39,3 @@ /** | ||
*/ | ||
const REGEX_FOR_OPTIONAL_0X_PREFIX_HEX = /^(0x)?[0-9a-f]*$/i; | ||
const REGEX_FOR_OPTIONAL_0X_PREFIX_HEX: RegExp = /^(0x)?[0-9a-f]*$/i; | ||
@@ -42,0 +42,0 @@ /** |
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 too big to display
Sorry, the diff of this file is not supported yet
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
978325
26155
+ Added@vechain/sdk-errors@1.0.0-beta.16(transitive)
+ Added@vechain/sdk-logging@1.0.0-beta.16(transitive)
- Removed@vechain/sdk-errors@1.0.0-beta.15(transitive)
- Removed@vechain/sdk-logging@1.0.0-beta.15(transitive)