Changes:
- Adjust
SubstrateNetworktyping withHexStringgenesisHash - Re-export
Constructor<T>type (deprecated, replaced withClass<T>)
Changes:
- Only allow padding characters in base64 strings
- Expand typings for keyring meta with known keys
- Adjust object index access for stricter tsconfig settings
Changes:
- Apply missing count assignment for
for (...)loops - Remove unused
@types/*dev dependencies - Upgrade dependencies to latest stable versions
Changes:
- Align
u8aToBigInttests withu8aToBn - Unroll loops on most-frequently used paths for
u8aToBigInt - Add
moduletopackage.jsonexport map (ESM-only) - Upgrade dependencies to latest stable versions
Changes:
- Adjust typing for
isChildClass&Constructorusage
Changes:
- Add shareable
identity&noopfunctions - Flatten
Buffer | Uint8Arraytypes (as used) to base-onlyUint8Array - Apply
readonlyspecifiers to private class fields where applicable - Adjust compilation output for
__internal__class fields - Remove unused types from
util - Upgrade dependencies to latest stable versions
Contributed:
- Add Cere genesisHash (Thanks to https://github.com/shamilkhan)
Changes:
- Swap secp256k1 functionality to
@noble/curves - Swap ed25519 functionality to
@noble/curves - Replace
tweetnaclsecretbox usage with slimmer local version - Adjust
isCodechelper with closer API alignment - Initial steps to multi-language bip39 support
- Use Node webcrypto for Node
getRandomValuessupport - Upgrade dependencies to latest stable versions
- Drop support for Node 14 (EOL 30 Apr 2023)
Contributed:
- Add Bittensor genesisHash (Thanks to https://github.com/camfairchild)
Changes:
- Allow empty string as valid base32/base58/base64 decoder input
- Add additional/missing
/*#__PURE__*/annotations - Upgrade dependencies to latest stable versions
Changes:
- Expand error details for invalid publicKeys in secp256k1 compress/expand operations
- Expand
@polkadot/hw-ledgerwith specific per-method JSDoc - Upgrade dependencies to latest stable versions
Contributed:
- Add 3DPass genesisHash (Thanks to https://github.com/fedosov)
Changes:
- Remove support for encrypt/decrypt functionality on keypair
- Upgrade dependencies to latest stable versions
Changes:
- Use consistent
.jsimports in source files (TS moduleResolution) - Remove TS resolveJsonModule option
- Upgrade to
@polkadot/wasm-crypto7.0.3
Changes:
- Change
@polkadot/x-wsto use ws package (previous:websocket) - Add
/*#__PURE__*/annotations for@polkadot/x-*packages - Swap TS -> JS compiler to use tsc (from babel)
- Adjust all tests to use
node:testrunner (ESM variants) - Move
cryptoWaitReady()top-level in test files - Upgrade to
@polkadot/wasm-crypto7.0.1
Contributed:
- Ledger support for Pendulum (Thanks to https://github.com/carlosala)
Changes:
- Ensure
u8aToU8acorrectly unwraps Buffer value (check ordering) - Upgrade dependencies to latest stable versions
Contributed:
- Locale support for number formatting (Thanks to https://github.com/alko89)
- Ledger support for Picasso (Thanks to https://github.com/carlosala)
Changes:
- Add
isClasshelper (checks if input is actual Class Constructor) - Adjust
isChildClassto rely on newisClass - Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for Ternoa (Thanks to https://github.com/mohsinriaz17)
Changes:
- Expand
arrayChunktests - Adjust output for Ledger sanity checks
- Expand exported
bigintconstants to match with those inBN - Adjust internal character maps to operate on
Uint8Arrayinstad ofArray<number> - Upgrade dependencies to latest stable versions
Changes:
- Drop stray
console.errorlog (it really is Friday 13th)
Changes:
- Bugfix for
formatBalance(forceUnit) withBNinputs where output is less than 0
Changes:
- Add the
withAll(default false) flag toformatBalanceto format to max decimals - Add the
withZero(default true) flags toformatBalanceto retain trailing zeros
Changes:
- Adjust
isBuffercheck onxglobal(no auto-polyfill detection on eg. parcel) - Upgrade dependencies to latest stable versions
Contributed:
- Adjust Nodle Ledger mapping (Thanks to https://github.com/aliXsed)
Changes:
- Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for Ajuna (Thanks to https://github.com/carlosala)
Changes:
has{Buffer, Process}now checks onglobalThis(helps bundlers with auto-injection)- Add
/*#__PURE__*/annotations for specificexport const something = someFunction(...) - Upgrade dependencies to latest stable versions
- Upgrade to
@polkadot/wasm-crypto6.4.1
Changes:
- Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for Origintrail (Thanks to https://github.com/carlosala)
Changes:
- Expand type descriptions around Ledger-based structures
- Upgrade dependencies to latest stable versions
Changes:
- Upgrade dependencies to latest stable versions
Changes:
- Upgrade dependencies to latest stable versions
Changes:
- Ensure
{bn, n, number}ToHex(0)always respectsbitLength - Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for VTB (Thanks to https://github.com/GuilaneDen)
Changes:
- Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for Darwinia, Phala & Khala (Thanks to https://github.com/carlosala)
- Ledger support for HydraX (Thanks to https://github.com/chcmedeiros)
Changes:
- Expand test cases
- Upgrade dependencies to latest stable versions
Changes:
- Hoist Ledger interface wrapError (internal adjustment)
- Upgrade dependencies to latest stable versions
Changes:
- Adjust
nextTickwith greater care for browser loops - Upgrade dependencies to latest stable versions
Changes:
- Adjust
ledgerAppsto use new@zondax/ledger-substrateinterfaces - Upgrade dependencies to latest stable versions
Contributed:
- Ledger support for Kusama Bifrost (Thanks to https://github.com/awesomepan)
Changes:
- Upgrade dependencies to latest stable versions
Changes:
- Optimization for empty
arrayFlattencase - Coding cleanups for logger (no
ascasting) - Optiomizations in assertion checks
Changes:
- Upgrade dependencies to latest stable versions
Changes:
- Add
arrayUnzipas reverse ofarrayZip - Adjust
objectSpreadto natively handleMapentries spreads - Adjust
isAsciicheck to disallow\t,\n, &\rcharacters - Adjust
nobodyzero-key pair with pre-computed address - Align
objectProperty&lazyMethodcall signatures (backwards compatible) - Various internal speed optimizations
- Upgrade dependencies to latest stable versions
Changes:
- Adjust async import in
x-fetchto be Jest-friendly
- Breaking change In this major version version previously deprecated function signatures have been removed. If still using the old forms for either
bnToHex,bnToU8a,formatBalance,hexToBnoru8aToBn, please update and only pass through an options object as the second parameter.
Contributed:
- Ledger support for Stafi (Thanks to https://github.com/kaelnew)
- Ledger support for Aleph Zero (Thanks to https://github.com/carlosala)
- Add genesis for HydraDX parachain (Thanks to https://github.com/jak-pan)
Changes:
- Remove deprecated signatures for
bnToHex,bnToU8a,formatBalance,hexToBn,u8aToBn - Align option handling of
n*(BigInt) functions withbn*(BN) - Allow for usage without
@types/nodeinstalled - Adjust for available ESM-only dependencies
- Upgrade dependencies to latest stable versions
- Upgrade to
@polkadot/wasm-crypto6.2.3
Changes:
- Upgrade to
@polkadot/wasm-crypto6.2.2
Changes:
- Update signatures where
readonlyarrays are used - Upgrade dependencies to latest stable versions
- Upgrade to
@polkadot/wasm-crypto6.2.1
Changes:
- Fix
hexToU8awhere0xis not correctly converted
Changes:
- Add
floatToU8aandu8aToFloat(both 32 & 64-bit, le & be) - Adjust
isUndefinedcheck (local variable available) - Adjust use of
assert,isUndefined&isNull
Contributed:
- Update Bifrost genesisHash (Thanks to https://github.com/awesomepan)
- Add Ledger support for Composable (Thanks to https://github.com/carlosala)
Changes:
- Add
u8aToNumber(limited, <= 48 bits) function - Use
~~as bitwise/fasterMath.floorreplacement - Remove unneeded
objectSpreadoption expansions - Optimize
hexToU8aoperations - Optimize
stringCamelCaseoperations - Optimize
u8aToBnoperations - Additional internal/external comments (as missing)
- Upgrade dependencies to latest stable versions
Changes:
- Add
nextTickto@polkadot/utilto defer execution to the queue - Upgrade dependencies to latest stable versions
Contributed:
- Add Ledger support for Parallel (Thanks to https://github.com/carlosala)
- Add Ledger support for Astar & Polkadex (Thanks to https://github.com/carlosala)
Changes:
- Adjust
u8aToU8achecks with betterisU8ashortcut - Adjust compact conversion with unrolled loops
- Adjust
string{Camel, Pascal}Casewith loop (no map) - Add
compactFromU8aLimvariant with Uint8Array-only inputs - Add
u8aConcatStrictvariant with Uint8Array-only inputs - Internal code maintainability enhancements
- Upgrade dependencies to latest stable versions
Contributed:
- Add Ledger support for Acala (Thanks to https://github.com/ntduan)
Changes:
- Optimize
u8aToHexwith direct (non-hex) conversion - Change all occurences of
.substr(...)to.substring(...) - Sync with upstream Substrate ss58 registry
- Mark deprecated function signatures (no removals)
- Re-enable auto init of
cryptoWaitReady() - Upgrade to
@polkadot/wasm-crypto6.1.1
Contributed:
- Add Ledger support for Statemint (Thanks to https://github.com/carlosala)
- Add Ledger support for xxnetwork (Thanks to https://github.com/xx-labs)
Changes:
- Adjust/dedupe output from
detectPackage - Adjust
isHexperformance test - Add field-level comments to some
*Optionsstructures - Add new Rococo genesisHash (reset)
- Breaking change In this major version the commonjs outputs are moved to a sub-folder. Since the export map and main field in package.json does reflect this change, there should be no usage changes. However the packages here will all need to be on the same version for internal linkage.
Changes:
- Be explicit in
@polkadot/util-cryptore-exports from@polkadot/networks - Output commonjs files under the
cjs/**root - Upgrade to
@polkadot/wasm-crypto6.0.1
Changes:
- Fix race-condition with wasm overrides, make
cryptoWaitReadylazy - Additional tests for
BN&BigIntnegative conversions - Upgrade to
@polkadot/wasm-crypto5.1.1
Important This contains an upgraded version of @polkadot/wasm-crypto. For users of asm.js, e.g. React Native, there are some additional upgrade instructions in the release notes for this version https://github.com/polkadot-js/wasm/releases/tag/v5.0.1
Contributed:
- Add aditional Dock mainnet genesis (Thanks to https://github.com/lovesh)
- Add Westend genesis (Thanks to https://github.com/Nick-1979)
- Update README with ss58 links (Thanks to https://github.com/Nick-197)
Changes:
- Ensure invalid secp256k1 publicKeys are not returned
- Cater for Expo v41+ in RN random value generation
- Fixed for RN environment imports
- Internal split of details in
@polkadot/networks - Additional workaround for Vite bundling
- Upgrade to
@polkadot/wasm-crypto5.0.1
Changes:
- Adjust for bundlers where
import.meta.urlis undefined - Upgrade dependencies to latest stable versions
Changes:
- Use upstream
@substrate/ss58-registry(instead of duplicating here) - Swap
micro-baseto@scure/base(same package, audited) - Bump
bn.jslibrary to latest 5.2.0 (has impact on e.g. API) - Upgrade dependencies to latest stable versions
Changes:
- Sync with upstream Substrate ss58 registry
Changes:
- Correct network sorting (primary by prefix, secondary by name)
- Sync with upstream Substrate ss58 registry
Changes:
- Fix
util-cryptobundle generation (adjustx-randomvalues) - Add all known Rococo genesis hashes
detectPackagenow uses optionalpath&type(esmorcjs) info- Ensure package paths are available via ESM and CJS
- Upgrade 3rd party dependencies to latest
- Pin
@noble/*to latest known tested integrated versions
Contributed:
- Add Bifrost Ledger capabilities (Thanks to https://github.com/awesomepan)
- Add Sora genesisHash & Ledger capabilities (Thanks to https://github.com/NoodleSploder)
Changes:
- Add
isPromisecheck utility function - Add
assertUnreachablefor codepaths that should not be followed - Preserve all-caps word splits in
stringCamelCase - Adjust
x-*fallbacks viax-global/extractGlobal - Sync with upstream Substrate ss58 registry
- Additional tests for
bip39wordlists - Maintainability cleanups
- Update to latest Ledger dependencies
- Swap to upstream
@noblepackages - Adjust tsconfig with references
- 8.2.2 (8.2.1 failed CI due to incorrect CHANGELOG)
Changes:
- Adjustment to non-full-word consecutive uppercase via
string{Camel, Pascal}Case
Contributed:
- Add Picasso genesisHash (Thanks to https://github.com/hussein-aitlahcen)
Changes:
- Allow for use of
secp256k1from@polkadot/wasm-crypto - Adjust
isBigIntto not doinstanceofcheck - Ensure consequtive capitals in
stringCamelCaseare lowercased - Use
@polkadot/x-bigintforBigIntconstructor - Split
@noble/hashesfork intox-noble-hashes - Add
@noble/secp256k1fork intox-noble-secp256k1, replaceselliptic
Changes:
- Adjust sha3 expectation of
BigIntavailability
Changes:
- Adjust
stringCamelCasewith leading_
Changes:
- Remove
Bufferusage inx-randomvalues - Adjust
stringCamelCasefor all-caps parts
Changes:
- Explicitly include BigInt patched versions
Important In the 8.0 version the hashing utilities have been consolidated around an optimized and audited version from @noble/hashes. As in the past the WASM hashing will be used by default if the environment is initialized.
Breaking change The schnorrkel* functions have been renamed to sr25519*. Likewise the ed25519 operations have been renamed from nacl* to ed25519*. Additionally the {ed, sr, secp256k1}25519KeyPairFrom* functions have been renamed to {ed, sr, secp256k1}25519PairFrom*.
Changes:
- Introduce
ed25519*&sr25519*functions - Replace camelcase dep with simplified/optimized version
- Replace (most) hashing operations with
@noble/hashes - Replace JS fallback for
xxhash - Adjust
BigIntutility exports (with capability detection) - Previously added
bi*functions renamed ton* - Extend performance tests with implementation compares
- Remove non-significant Node Buffer concat fill
Changes:
- Fix TS compiled definitions for
base*types - Provide JS/Wasm interfaces for
hmacShaAsU8a
Contributed:
- Updated Polymesh genesisHash (Thanks to https://github.com/adamdossa)
Changes:
- Add strongly typed
object{Entries, Keys, Values}utilities - Add
{hex, u8a}ToBigIntutilities - Add
bi*utilities forbigintoperations (mirror ofbn*) - Add
stringPascalCaseutility - Add
isCodecto check for Codec-like structures - Add
has*detection shortcuts (e.g.hasWasmorhasBuffer) - Add
sha256AsU8autil (& replace use internally) - Optimize for
hexToU8aandu8aToHexfunctions - Optimize
u8aEqto useDataViewfor compares - Align
base{32, 58, 64}*around (audited)micro-base - Space optimization for bip39 wordlists
- Sync with upstream Substrate ss58 registry
- Expand tests for uncovered functions
Changes:
- Expose internal
isArraycheck - Move
object{Property, Properties}from api repo
Contributed:
- Added Acala genesisHash (Thanks to https://github.com/qwer951123)
Changes:
- Add
objectClearandobjectSpreadutility functions - Add
lazyMethod&lazyMethodsutility functions - Sync with upstream Substrate ss58 registry
Contributed:
- Add Genshiro support (Thanks to https://github.com/Overseven)
Changes:
- Add
arrayZipto combine a key + value array into entries-like - Assert
chainCodeinputs toderive*, protecting against misuse - Adjust testnet detection in
@polkadot/networks - Adjust base library usage of
forvsreduce/map - Bump Ledger libraries to latest versions
Changes:
- Update
xxhash*to only useUint8Arrayinternally, noBuffer - Adjust
isAsciito check against original string codepoints (when provided) - Adjust networks to sync with
paritytech/ss58-registry - Dedupe internal sr25519/ed25519 derivation functions
- Bump Ledger libraries to latest versions
Contributed:
- Fix comment on
blake2AsU8a(Thanks to https://github.com/tomokazukozuma) - Update Ethereum derivation process (Thanks to https://github.com/joelamouche)
Changes:
- Derivation paths now caters for >
MAX_SAFE_INTEGERunsigned values - Sync with upstream Substrate ss58 registry
- Update ss58 registry handling (both previous and current versions)
Changes:
- Add
u8aWrapBytes&u8aUnwrapBytes(originally from@polkadot/extension-dapp) - Verify both wrapped and unwrapped signatures transparently
- Adjust
isHexreturn to0x${string}under TypeScript - Adjust shared repo Jest config
- Sync with upstream Substrate ss58 registry
- Cleanup rollup build where
x-globalyields undefined
Contributed:
- Added Bifrost genesisHash (Thanks to https://github.com/awesomepan)
- Added Stafi genesisHash (Thanks to https://github.com/Tore19)
- Add Ledger support for Nodle (Thanks to https://github.com/ETeissonniere)
Changes:
- Add support for
schnorrkelAgreement(as exposed by newwasm-crypto) - Ensure
schnorrkel*functions allows hex inputs @polkadot/wasm-crypto4.2.1- Sync with upstream Substrate ss58 registry
Contributed:
- Always use
biginttype to indicate instance (Thanks to https://github.com/ntduan)
Changes:
- Added
u8aEmptyhelper check, all 0 or no length - Cleanup additional circular dependencies detected by rollup
Changes:
- Ensure
@polkadot/util-cryptodoesn't re-exportpackageInfofrom@polkadot/networks - Minor TS style cleanups in
@polkadot/x-bundle
Contributed:
- Add keyring encrypt/decrypt functionality (Thanks to https://github.com/RoyTimes)
Changes:
- Bump Ledger libraries to latest versions
Changes:
- Sync with upstream Substrate ss58 registry
- Bump Ledger libraries to latest versions
Changes:
- Added
isCompactutility for check on compact-like types - Sync with upstream Substrate ss58 registry
- Breaking change The
@polkadot/x-rxjspackage has been removed. Inrxjs7.2.0 the compatibility issues at the base layer has been solved. - Breaking change The named exports in
@polkadot/networkshas been changed
Contributed:
- Add Ledger config for Centrifuge (Thanks to https://github.com/mikiquantum)
Changes:
- Adjust
@polkadot/networksto fully-descriptive exports - Remove
@polkadot/x-rxjs, direct import fromrxjs >= 7.2.0required - Allow building as a completely stand-alone browser bundle (experimental)
- Sync with upstream Substrate ss58 registry
Changes:
- Cleanup unneeded dependencies for
@polkadot/x-global - Sync with upstream Substrate ss58 registry
- Bump Zondax dependencies (Statemine slip44 fix)
Contributed:
- Add Karura genesisHash (Thanks to https://github.com/ntduan)
Changes:
isHex(value)will now check for onlystringtypes (NoStringclasses)- Added
arrayShuffle(array)to shuffle an array into a new output - Added Statemine Ledger app information
- Simplify tests to use
{describe|it}.eachwhere applicable - Sync with upstream Substrate ss58 registry
Changes:
- Added
u8aCmp(a, b)to do sorting compares - Added
arrayRange(size, startAt = 0)to create a range of numbers - Added extensive mnemonic compare test (optional, skipped)
Contributed:
- Add Ledger support for Edgeware (Thanks to https://github.com/raykyri)
- Fix
naclSealdoc types (Thanks to https://github.com/agustinustheo)
Changes:
- Export
BNin@polkadot/util - Sync with upstream Substrate ss58 registry
Changes:
- Add WebHID transport for Ledger
- Update to latest Ledger transport packages
- Remove old
Geraldkey for Moonbeam - Cleanup testing keyring semgrep recommendations
Changes:
- Adjust HD path validation & replacement
- Sync with Substrate ss58 registry
Changes:
- Allow hdLedger derivation with optional 25th word password
- Sync with Substrate ss58 registry
Contributed:
- Update genesis for HydraDx gen-3 (Thanks to https://github.com/jak-pan)
- Allow Ethereum pair in keyring addAddress (Thanks to https://github.com/joelamouche)
Changes:
- Added additional double-byte ss58 tests
- Aligned ss58 registry with Substrate
- Add explicit log for deprecation of
setSS58Format
Changes:
- Added
stringifyutil to correctly handleJSON.stringifywithBigIntvalues - Additional input asserts for non-convertible values in
u8aToU8a - Adapt
@polkadot/x-globalto returnglobalThisas available - Minor readability cleanups
- BN manipulation via in-place shifts (as applicable)
- Add explicit
enginesconfig topackage.json
Contributed:
- Added HydraDx genesis (Thanks to https://github.com/jak-pan)
Changes:
- Add
isAddressandvalidateAddressfunctions (the latter will throw if invalid) - Check
@polkadot/hw-ledgeragainst@polkadot/networksfor discrepancies (test-only) - Align ss58 registry with upstream Substrate
Contributed:
- Adjust Polymath genesis in
@polkadot/networks(Thanks to https://github.com/adamdossa) - Adjust
@polkadot/utillogger for +/-/* compat (Thanks to https://github.com/Lezek123) - Fix typo in
@polkadot/utildetect messaging (Thanks to https://github.com/amphineko)
Changes:
- Remove
@polkadot/networkscode duplication, manages data via script from upstream - Align ss58 registry with upstream Substrate
Changes:
- Fix for
@polkadot/x-rxjsin Node CJS environments (no Node-specific import)
Contributed:
- Enhance check for global process existence (Thanks to https://github.com/Yuripetusko)
Changes:
- Dedupe & optimize logger process.env checks
Changes:
- Add import indirection for both CJS & ESM (where generated source file is commonjs)
Changes:
- Fix
@polkadot/x-rxjsESM exports for Node environments (now different due to the ESM conversion)
Important In the 6.0 version the default package type has been changed to ESM modules by default. This should not affect usage, however since the output formats changed, a new major version is required.
Contributed:
- Add dev addresses for Frontier-based chains (Thanks to https://github.com/joelamouche)
Changes:
- Build to ESM by default (with cjs versions via export map)
- Allow addition or raw pairs on the keyring via
{add, create}FromPair - Extract re-usable json encryption/decryption functions
Changes:
- Fix package detection for
@polkadot/networks(no dependencies)
Changes:
- Expand
detectPackagewith optional param allowing checks for monorepo versions - Export logger
formatfunction directly asloggerFormat - Expand tests and checks for
hdValidatePath - Remove
hdEthereumclass-based approach, simplify - Cleanup formatting on nested conditionals in the
@polkadot/x-packages - All packages now export
packageInfofrom the root
Contributed:
- Add ss58 information for HydraDX (Thanks to https://github.com/jak-pan)
- HD derivation for Ethereum (Thanks to https://github.com/joelamouche)
Changes:
- Adjust base64 encoding/decoding to not rely on Buffer being available
- Rework Ethereum derivation to only use Uint8Array internally
- Shared HD path validation for Ledger & Ethereum
- Additional derivation, encoding and decoding tests on keyring
- Align networks with upstream ss58 registry
@polkadot/wasm-crypto3.2.4
Breaking change The signature of pair.verify now requires the signer public key as a parameter. If using pair.verify pass the publicKey (hex or Uint8Array) of the signer.
Changes:
- The signature on the keyring for
.verifynow explicitly requires thepublicKeyof the signer. Previously it only verified against an own public key. - Add additional ss58 test vectors (against chains with >63 prefixes in the Substrate registry)
Contributed:
- Add ss58 information for Aventus (Thanks to https://github.com/nahuseyoum)
Changes:
- Add
unlock(password)to keypair (less confusing than only havingdecodePkcs8, equivalent tolock()) - Change use of
detectPackageto usepackageInfo.ts - Align with upstream ss58 registry
@polkadot/wasm-crypto3.2.3
Changes:
@polkadot/networksnow filters the new upstream-introducednullnetworks
Contributed:
- Fix installation instructions in
@polkadot/x-global(Thanks to https://github.com/raoulmillais)
Changes:
- Conform to new ss58 encoding with ids up to 16,383 (>= 64 as 2 bytes)
- Use JS sqrt inside
bnSqrtwhen value <= MAX_SAFE_INTEGER - Adjust all
Buffer.fromusages, preferUint8Arraywhere possible - Expand tests for keyring with
vrf{Sign, Verify} - Align
@polkadot/networkswith latest ss58 registry
Changes:
- Expose
BN_{MILLION, BILLION}constants (in addition to 2-9)
Changes:
- Added
hdLedgerto util-crypto for Ledger-compatible bip32+ed25519 derivation - Added
hmac{Sha256, 512}to util-crypto - Add
slip44indices for Ledger into@polkadot/networks - Remove
moduleentry inpackage.json(only rely on exports map) - Remove direct references to
globalobject, use@polkadot/x-global - Update
@ledgerhqdependencies to latest
Contributed:
- Adjust Ledger app lookup for Polymesh (Thanks to https://github.com/adamdossa)
Changes:
- Allow decimals as
number[]& symbol asstring[]in balanceFormat defaults - Add
schnorrkelVrf{Sign, Verify}to@polkadot/util-crypto - Export
vrf{Sign, Verify}on keyring interface - Move
@polkadot/x-rxjspackages from the api repo - Align
@polkadot/networkswith Substrate master - Explicit edcsa tests for derivation
@polkadot/wasm-crypto3.2.1
Important For users of the @polkadot/ledger package, it is now included in this repo (since it is a general utility) and renamed to @polkadot/hw-ledger
Contributed:
- Add Dock Ledger integration (Thanks to https://github.com/lovesh)
- Add Polymesh Ledger integration (Thanks to https://github.com/adamdossa)
- Add flag for Ledger capabilities on networks (Thanks to https://github.com/Tbaut)
Changes:
- Move
@polkadot/ledgerpackages into common - Update
@polkadot/networksto align with latest Substrate ss58-registry
Changes:
- Add
arrayFlattento merge a series of arrays into a single - Add
arrayChunkto chunk an array into multiples of defined size - Add
bitLengthparam (allowed 256, 512) tokeccakAs{Hex, U8a} - Align
@polkadot/networkswith Substrate master
Changes:
detectPackagenow can take a path-retrieval callback as second argument- Adjust
blake2jsimports to consistently cater for esm & cjs usage - Explicitly mark
detectPackageusage as having side-effects - Align
@polkadot/networkswith Substrate master @polkadot/wasm-crypto3.1.1
Important While this package contains no external interface changes, it now compiles and ships both cjs and esm modules. This means that modern bundlers will have more information for tree-shaking available. Additionally when using Node with .mjs extensions, the esm version imports will be used on recent Node versions. Adding an export map, as here, may have some impacts so a major semver bump is advised. There may be (small) dragons hiding in the dark corners...
Changes:
- Build and expose both cjs and esm via exports map
- Use
import type { ... }form for all type imports - Align with Substrate master network list
- Debug logs now don't depend on
NODE_ENV, but ratherDEBUG=<type,type,...>(*logs all) - Limit debug console output via
DEBUG_MAX=<number>value, trimming when passed - Add
memoizeutil, allowing for function memoization (as used in the API) - Align
@polkadot/networkswith Substrate master @polkadot/wasm-crypto3.0.1
Changes:
- Rename default Mega to Million, Giga to Billion and Tera to Trillion in formatter
- Dedupe bn.js by aligning versions between different libraries
- Add explicit link to base Substrate ss58 formats (as managed in
@polkadot/util)
Contributed:
- Expand ETH tests, allow for verification against address (Thanks to https://github.com/joelamouche)
Changes:
- Replace pbkdf2 imports with explicit use from sync-only package
- Adjust secp256k1 imports with shared elliptic
- Expand crypto tests for explicit wasm vs JS compares in all cases
- Breaking change Polyfills are not injected by these libraries anymore to avoid clobbering external globals, the user should provide them if their environment is missing base functionality.
Changes:
- Remove built-in utility polyfills for
Array.fill,String.padStart,String.padEndas well asObject.setPrototypeOf. These should be provided by the actual user of the libraries if so required. - Update
@polkadot/wasm-cryptolibrary (under-the-hood cleanups) - Remove explicit crypto polyfill injection (aligning with updated
@polkadot/wasm-crypto) - Add cross-environment
@polkadot/x-randomvalues(for use in@polkadot/wasm-crypto)
Changes:
- Remove the use of
chalk(logger) for less overall dependencies string*utilities now also allowsString(class) inputs- Align bip39 use with wasm-crypto for English-only wordlist, default, non supplied)
- Adjust elliptic imports for explicit paths (allows tree-shaking)
- Add Totem (ss58 prefix 14) into
@polkadot/networks - Move
@polkadot/x-{fetch,textdecoder,textencoder,ws}intocommonrepo
Contributed:
- Add evmToAddress and addressToEvm
@polkadot/util-crypto(Thanks to https://github.com/jnaviask) - Remove invalid link to docs (thanks to https://github.com/roccomuso)
Changes:
- Rename
mnemonicToBip39tomnemonicToLegacySeed(used in non-Substrate compatible fashion) - Update pair signature verification to handle MultiSignature results
- Move documentation to docs repo
- Added
@polkadot/networksfor a list of known networks and their identifying information
Contributed:
- Add Dock network identifiers (Thanks to https://github.com/lovesh)
Changes:
- Use cross-environment TextDecoder & TextEncoder from the polkadot-js polyfills
- Add
isBase{32, 58, 64}to@polkadot/util-crypto - Add
base64{Pad, Trim}to add/remove padding characters - Add
createFromJson(json)to keyring (create pair without adding) - Balance formatter now outputs 4 numbers after the decimal point
Changes:
- Allow for WASM-as-available
mnemonicToBip39call (used for Ethereum-compatible keypairs) - Add
isWasmutility to check for valid WASM headers @polkadot/wasm-crypto1.4.1
Changes:
- Add
addressRawto Keyring interface (if address encoding is different to publicKey) - Allow for Ethereum pair signing and verification
Changes:
- Allow for (optional, default blake2) hasher to secp256k1 sign/verify functions
- Utilities for secp256k1 publicKey expansion and compression
- Add basic Ethereum address utils (encode with checksum & checksum verification)
- Add Ethereum-compatible
mnemonicToBip39seed creation function
Changes:
- Add
deriveAddress(<address>, '/<soft>/<soft-b>')via sr25519 soft - Use
scryptfrom WASM as available (JS fallback in place) - Add
base32{Encode, Decode}utilities (IPFS-compatible alphabet) - Support IPFS compatibility flag in base58 encoding/decoding
- Update to
@polkadot/wasm-crypto1.3.1
Contributed:
- Add Katal ss58Format (Thanks to https://github.com/retotrinkler)
Changes:
- Adjust JSON pair output with scrypt kdf (version 3 output)
Changes:
- Add
base64{Decode, Encode, Validate}as crypto utils - Extract
base58Validatefrom base58 decode checks - Add
isAsciito allow detection of printable ASCII sequences (including tab, newline) - Add
isUtf8to allow detection of valid Utf8 sequences
Changes:
- Add
encode{Derived, Multi}Addressto encode derived/multi addresses - Correctly handle 0 inputs in
numberToU8a - Simplify and flatten base58 dependencies
Changes:
- Adjust
addressCheckandencodeAddressfunction to check for valid base58 alphabets (better error reporting) - Rename
createKeySubtocreateKeyDerivedbased on changed in Substrate (sub keys now named derived)
Changes:
- Adjust keyring to no override 0-prefix (Polkadot live) settings with keychain default
Contributed:
- Add
extractTimeutility conversion (Thanks to https://github.com/kwingram25)
Changes:
- Fix JS blake2 fallback (non-wasm) to correctly deal with hex inputs
- Align
bnToHexsignature withbnToU8a(with old/new style) - Allow
bnTo{Hex,U8a}to take any value with.toBn()signatures
Changes:
- Fix
isFunctionsignature to assertFunction
- Important Removed
mnemonicToSeed, it is only for bip39, usemnemonicToMiniSecretfor the Substrate variant
Changes:
- Added
u8aEqto compare two Uint8Array or hex values for an exact match - Added
addressEqto compare two addresses (ss58, Uint8array or hex) for an exact match - Throw error on
{nacl,schnorrkel}Verifyon invalid input lengths - Performance optimizations in
u8aToHex&u8aConcat
Changes:
- Internal cleanups on typings
- Support for latest TypeScript, eslint & typescript-eslint
Contributed:
- Add Kulupu ss58 prefix as an allowed value (Thanks to https://github.com/sorpaas)
Changes:
- Make the
TextEncoderpolyfill handle non-compliant Buffer implementations (newer versions of Jest) DeriveJunctionnow also allows for BigInt values (aligning with number types elsewhere)- Small code-flow optimizations
Contributed:
- Add support for ECDSA keypairs (Thanks to https://github.com/akru)
Changes:
- Added
createKeyMulti&createKeySubto create utility sub & multi keys - Added
u8aSortedto sortUint8Arrays - Added
sortAddressesto sort addresses based on their internal representation
- Keypair will now throw an error when attempting to sign/derive using a locked pair (Thanks to https://github.com/h4x3rotab)
Changes:
- Cleanup
isDevelopmentregex to cater for chains such asWestend Development
Changes:
- Add
bnSqrtto calculate the integer sqrt via Newton iteration - Allow for optional wasm-crypto, specifically via
@polkadot/util-crypto/noWasm - Misc. CI infrastructure cleanups
- Breaking change Following on the 2.0 release,
@polkadot/wasmwas updated to 1.1+. sr25510 now only verifies 0.8+ signatures, closing the loop on dropping Substrate 1.x-era support
Changes:
- Add
signatureVerify (message: Uint8Array | string, signature: Uint8Array | string, addressOrPublicKey: Uint8Array | string): VerifyResultto verify any signature, regardless of type. Returns validity & detected crypto type. - Add
cryptoIsReady (): booleanfunction to check status of initialization - Add
addressCheckChecksum (decoded: Uint8Array)as an helper to extract and verify the ss58 checksum - Swap to yarn 2, allow use in yarn 2 projects
- Breaking change (TypeScript only) The
*.d.tsfiles now contain TypeScript 3.8 features,#private, which is not usable in older versions
Changes:
- Add
isBigInt(value)to allowBigIntchecks. Also add support inbnToBnas well as number conversion utils - Add
isChildClass(Parent, Child?)to check if a class extends the parent, asserting Child is Parent - (internal) Use
#<field>instead ofprivate _<field>for private class variables
Changes:
- Ensure that
formatBalancedoes not apply unit overrides apply when no SI is applicable - Adjust
formatBalance(<balance>, <options>)to take expandedwithUnit: string | booleanoption where string is an actual unit, e.g.KSM - The
decimalsoption toformatBalanceshould now be passed as part of theoptions(previous last-param deprecated) - The
.setSS58Formaton keyring will now just operate on pairs created on the keyring, not globally. The globalsetSS58Formatin@polkadot/util-cryptowill be deprecated. - The deprecated
addressPrefixoption to keyring has been belatedly removed (Usess58Formatrather)
Contributed:
- Remove dependency on moment.js with
formatDatefunction (Thanks to https://github.com/AndreasGassmann) - Move TypeScript
@types/*to dev deps (Thanks to https://github.com/AndreasGassmann)
Changes:
- Update to
@polkadot/wasm-crypto1.0 - Cleanup dependencies to pave the way for using yarn 2 (Explicit instead of implicit)
Changes:
- Add resolver for jest requires (tests from src)
Changes:
- Update
detectPackage(<package.json>, __dirname?)with calling folder
Changes:
- Update w3f/schnorrkel to 0.8.5 (Full Substrate 2.x support, no 1.x support)
- Remove Alice session (ed2551) account from testing keyring (not applicable to Substrate 2.x)
- Remove
chainspec,db,trie-codec,trie-dbandtrie-hashpackages (moved to client) - Renamed
assertSingletonPackagetodetectPackagewith inclusion of version listing - Swap to elliptic library for secp2561 recovery (No node bindings)
Contributed:
- Add cross-client encryption/decryption support (Thanks to https://github.com/hskang9)
Changes:
formatBalancesignature now allows to force unit displays- Keypair now allows for derive on a pair, with
pair.derive(...) assertnow acts like a real asserts, with no return - signature adapted for new TS 3.7
Changes:
pair.sign(message)now takes an optional secondoptions?: SignOptionsparameter, whereSignOptionsis currently defined as{ withType: boolean }. HerewithTypeinstructs the signing to prepend the type of signature (ed2551, sr25519 or ecdsa). This is used for the new Polkadot/Substrate MultiSignature format.
Changes:
- Fix typings on the Keyring-exposed encode & decodeAddress
- Allow ss58Format = 0 as a valid value
- Loosen type definitions for allowed ss58format values (still checked against allowed array)
- Breaking change To set the
ss58Format, you should now usesetSS58Formatas opposed to the oldsetAddressPrefix
Changes:
- Renamed
keyring.setAddressPrefixtokeyring.setSS58Format - Deprecated
addressPrefixon the keyring options, added thess58Formatas a replacement (aligning with chain properties - the old version is still accepted) - Added
stringToHexandhexToStringconversion utilities to@polkadot/util - Swap to Babel 7.6.0 for all compilation, for latest improvements in code generation
Changes:
- Remove the
ExtErrorclass, always prefer the standard JSErrorobject for errors. This would bre a breaking change for any applications usingExtError
Changes:
- Keyring
addFromAddresscan now be used to store external accounts, for example those provided by external signers - Maintainability updates
Changes:
assertSingletonPackagenow warns via console.warn, but does not throw. This does allow the info to come accross while still allowing the app developers using multiple libraries time to fix.
Changes:
formatBalancenow allows forCompactinputsformaBalancenow allows correct formatting of very large decimals
Changes:
- Add
checkAddress(address, prefix)to@polkadot/util-cryptothat validates an ss-58 address - Add support for the Kusama network (as a valid checked prefix)
- Add an
asm.jsfallback for the React Native environment (via@polkadot/wasm-crypto) - The ed25519 key for Alice (representing the session), now appears in the test keyrings
- Fix missing dependencies for keyring (after address moves in 0.93.1)
Changes:
- Breaking: External pair interface for keyring has been changed. Instead of
getMetause themetagetter, i.e.console.log(pair.meta.name)addressuse theaddressgetter, i.e.console.log(pair.address)publicKeyuse thepublicKeygetter, i.e.console.log(pair.publicKey)
Move decodeAddress,encodeAddress&setAddressPrefixfunctions into@polkadot/util-cryptofrom@polkadot/keyring. External interfaces should not be affected at this point since it is also (still) exported and exposed on keyring
Changes:
- Only allow integer input values into
formatBalance - Allow
formatBalance,formatDecimal&formatNumberto cater for negative numbers - Add 'Bob//stash' to testing keyring, joining the existing 'Alice//stash'
Changes:
- ed25519/sr25519 sign & verify functions can now take the message input as Uint8Array/string/hex and verify allows for the signature/publicKey to be specified as Uint8Array/hex
- Update
@polkadot/wasmto include a maintenance bump for thew3f/schnorrkellibraries
Changes:
- Moving towards 1.0
- Added bnMin & bnMax functions
Changes:
- Fix
addFromMnemonicto generate using new-style derivation. - Pull in
formatBalance,formatDecimal,formatElapsed,formatNumber,calcSi,findSi&isTestChainutility functions from the originals in@polkadot/ui-util - Swap out
wasm-schnorrkel&wasm-ed25519for combined version withwasm-crypto - Swap DB interfaces to optional LRU, removing
transactionAsync(client-only changes)
Changes:
- Start journey to 1.0
Changes:
- Add
assertSingletonPackageto util - Ensure that only a single keyring instance is loaded (uses above)
Changes:
- Extensions to the client-specific database interfaces (non-breaking for API and util users)
Changes:
- Add additional derivation path extraction mechanisms to util-crypto
- Add createFromUri function to keypair (creates keypair, does not add it)
- Allow all crypto hashing & ed25519 to use WASM (as available, JS fallbacks)
Changes:
- Pull in bip39 generation functions from
@poladkot/wasm-cryptowith a fallback to the pure JS versions
Changes:
- Align with current substrate master for sr25519 keys and hard/soft derivation
- Swap default dev keys to derived (sr25519)
Changes:
- Swap to publishing -beta.x on merge (non-breaking testing)
Changes:
- Add
fromUrito keyring along with hard & soft key derivation.
Changes:
- Remove NodeJs-only
syncifyfunction, not exported by the package (with binary dependency for Node)
Changes:
- Keyring now allows for ed25519 and sr25519 instances. Upon creation, you need to pass the
ed25519orsr25519string to denote the type, i.e.new Keyring({ type: 'sr25519' })