@reef-defi/x-bundle
A rollup-only package to allow for bundling of builtin dependencies
A bundler helper
A rollup-only package to allow for bundling of builtin dependencies
@reef-defi
Changes:
isArray
checkobject{Property, Properties}
from api repoContributed:
Changes:
objectClear
and objectSpread
utility functionslazyMethod
& lazyMethods
utility functionsContributed:
Changes:
arrayZip
to combine a key + value array into entries-likechainCode
inputs to derive*
, protecting against misuse@polkadot/networks
for
vs reduce/map
Changes:
xxhash*
to only use Uint8Array
internally, no Buffer
isAscii
to check against original string codepoints (when provided)paritytech/ss58-registry
Contributed:
blake2AsU8a
(Thanks to https://github.com/tomokazukozuma)Changes:
MAX_SAFE_INTEGER
unsigned valuesChanges:
u8aWrapBytes
& u8aUnwrapBytes
(originally from @polkadot/extension-dapp
)isHex
return to 0x${string}
under TypeScriptx-global
yields undefinedContributed:
Changes:
schnorrkelAgreement
(as exposed by new wasm-crypto
)schnorrkel*
functions allows hex inputs@polkadot/wasm-crypto
4.2.1Contributed:
bigint
type to indicate instance (Thanks to https://github.com/ntduan)Changes:
u8aEmpty
helper check, all 0 or no lengthChanges:
@polkadot/util-crypto
doesn't re-export packageInfo
from @polkadot/networks
@polkadot/x-bundle
Contributed:
Changes:
Changes:
Changes:
isCompact
utility for check on compact-like types@polkadot/x-rxjs
package has been removed. In rxjs
7.2.0 the compatibility issues at the base layer has been solved.@polkadot/networks
has been changedContributed:
Changes:
@polkadot/networks
to fully-descriptive exports@polkadot/x-rxjs
, direct import from rxjs >= 7.2.0
requiredChanges:
@polkadot/x-global
Contributed:
Changes:
isHex(value)
will now check for only string
types (No String
classes)arrayShuffle(array)
to shuffle an array into a new output{describe|it}.each
where applicableChanges:
u8aCmp(a, b)
to do sorting comparesarrayRange(size, startAt = 0)
to create a range of numbersContributed:
naclSeal
doc types (Thanks to https://github.com/agustinustheo)Changes:
BN
in @polkadot/util
Changes:
Gerald
key for MoonbeamChanges:
Changes:
Contributed:
Changes:
setSS58Format
Changes:
stringify
util to correctly handle JSON.stringify
with BigInt
valuesu8aToU8a
@polkadot/x-global
to return globalThis
as availableengines
config to package.json
Contributed:
Changes:
isAddress
and validateAddress
functions (the latter will throw if invalid)@polkadot/hw-ledger
against @polkadot/networks
for discrepancies (test-only)Contributed:
@polkadot/networks
(Thanks to https://github.com/adamdossa)@polkadot/util
logger for +/-/* compat (Thanks to https://github.com/Lezek123)@polkadot/util
detect messaging (Thanks to https://github.com/amphineko)Changes:
@polkadot/networks
code duplication, manages data via script from upstreamChanges:
@polkadot/x-rxjs
in Node CJS environments (no Node-specific import)Contributed:
Changes:
Changes:
Changes:
@polkadot/x-rxjs
ESM 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:
Changes:
{add, create}FromPair
Changes:
@polkadot/networks
(no dependencies)Changes:
detectPackage
with optional param allowing checks for monorepo versionsformat
function directly as loggerFormat
hdValidatePath
hdEthereum
class-based approach, simplify@polkadot/x-
packagespackageInfo
from the rootContributed:
Changes:
@polkadot/wasm-crypto
3.2.4Breaking 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:
.verify
now explicitly requires the publicKey
of the signer. Previously it only verified against an own public key.Contributed:
Changes:
unlock(password)
to keypair (less confusing than only having decodePkcs8
, equivalent to lock()
)detectPackage
to use packageInfo.ts
@polkadot/wasm-crypto
3.2.3Changes:
@polkadot/networks
now filters the new upstream-introduced null
networksContributed:
@polkadot/x-global
(Thanks to https://github.com/raoulmillais)Changes:
bnSqrt
when value <= MAX_SAFE_INTEGERBuffer.from
usages, prefer Uint8Array
where possiblevrf{Sign, Verify}
@polkadot/networks
with latest ss58 registryChanges:
BN_{MILLION, BILLION}
constants (in addition to 2-9)Changes:
hdLedger
to util-crypto for Ledger-compatible bip32+ed25519 derivationhmac{Sha256, 512}
to util-cryptoslip44
indices for Ledger into @polkadot/networks
module
entry in package.json
(only rely on exports map)global
object, use @polkadot/x-global
@ledgerhq
dependencies to latestContributed:
Changes:
number[]
& symbol as string[]
in balanceFormat defaultsschnorrkelVrf{Sign, Verify}
to @polkadot/util-crypto
vrf{Sign, Verify}
on keyring interface@polkadot/x-rxjs
packages from the api repo@polkadot/networks
with Substrate master@polkadot/wasm-crypto
3.2.1Important 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:
Changes:
@polkadot/ledger
packages into common@polkadot/networks
to align with latest Substrate ss58-registryChanges:
arrayFlatten
to merge a series of arrays into a singlearrayChunk
to chunk an array into multiples of defined sizebitLength
param (allowed 256, 512) to keccakAs{Hex, U8a}
@polkadot/networks
with Substrate masterChanges:
detectPackage
now can take a path-retrieval callback as second argumentblake2js
imports to consistently cater for esm & cjs usagedetectPackage
usage as having side-effects@polkadot/networks
with Substrate master@polkadot/wasm-crypto
3.1.1Important 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:
import type { ... }
form for all type importsNODE_ENV
, but rather DEBUG=<type,type,...>
(*
logs all)DEBUG_MAX=<number>
value, trimming when passedmemoize
util, allowing for function memoization (as used in the API)@polkadot/networks
with Substrate master@polkadot/wasm-crypto
3.0.1Changes:
@polkadot/util
)Contributed:
Changes:
Changes:
Array.fill
, String.padStart
, String.padEnd
as well as Object.setPrototypeOf
. These should be provided by the actual user of the libraries if so required.@polkadot/wasm-crypto
library (under-the-hood cleanups)@polkadot/wasm-crypto
)@polkadot/x-randomvalues
(for use in @polkadot/wasm-crypto
)Changes:
chalk
(logger) for less overall dependenciesstring*
utilities now also allows String
(class) inputs@polkadot/networks
@polkadot/x-{fetch,textdecoder,textencoder,ws}
into common
repoContributed:
@polkadot/util-crypto
(Thanks to https://github.com/jnaviask)Changes:
mnemonicToBip39
to mnemonicToLegacySeed
(used in non-Substrate compatible fashion)@polkadot/networks
for a list of known networks and their identifying informationContributed:
Changes:
isBase{32, 58, 64}
to @polkadot/util-crypto
base64{Pad, Trim}
to add/remove padding characterscreateFromJson(json)
to keyring (create pair without adding)Changes:
mnemonicToBip39
call (used for Ethereum-compatible keypairs)isWasm
utility to check for valid WASM headers@polkadot/wasm-crypto
1.4.1Changes:
addressRaw
to Keyring interface (if address encoding is different to publicKey)Changes:
mnemonicToBip39
seed creation functionChanges:
deriveAddress(<address>, '/<soft>/<soft-b>')
via sr25519 softscrypt
from WASM as available (JS fallback in place)base32{Encode, Decode}
utilities (IPFS-compatible alphabet)@polkadot/wasm-crypto
1.3.1Contributed:
Changes:
Changes:
base64{Decode, Encode, Validate}
as crypto utilsbase58Validate
from base58 decode checksisAscii
to allow detection of printable ASCII sequences (including tab, newline)isUtf8
to allow detection of valid Utf8 sequencesChanges:
encode{Derived, Multi}Address
to encode derived/multi addressesnumberToU8a
Changes:
addressCheck
and encodeAddress
function to check for valid base58 alphabets (better error reporting)createKeySub
to createKeyDerived
based on changed in Substrate (sub keys now named derived)Changes:
Contributed:
extractTime
utility conversion (Thanks to https://github.com/kwingram25)Changes:
bnToHex
signature with bnToU8a
(with old/new style)bnTo{Hex,U8a}
to take any value with .toBn()
signaturesChanges:
isFunction
signature to assert Function
mnemonicToSeed
, it is only for bip39, use mnemonicToMiniSecret
for the Substrate variantChanges:
u8aEq
to compare two Uint8Array or hex values for an exact matchaddressEq
to compare two addresses (ss58, Uint8array or hex) for an exact match{nacl,schnorrkel}Verify
on invalid input lengthsu8aToHex
& u8aConcat
Changes:
Contributed:
Changes:
TextEncoder
polyfill handle non-compliant Buffer implementations (newer versions of Jest)DeriveJunction
now also allows for BigInt values (aligning with number types elsewhere)Contributed:
Changes:
createKeyMulti
& createKeySub
to create utility sub & multi keysu8aSorted
to sort Uint8Arrays
sortAddresses
to sort addresses based on their internal representationChanges:
isDevelopment
regex to cater for chains such as Westend Development
Changes:
bnSqrt
to calculate the integer sqrt via Newton iteration@polkadot/util-crypto/noWasm
@polkadot/wasm
was updated to 1.1+. sr25510 now only verifies 0.8+ signatures, closing the loop on dropping Substrate 1.x-era supportChanges:
signatureVerify (message: Uint8Array | string, signature: Uint8Array | string, addressOrPublicKey: Uint8Array | string): VerifyResult
to verify any signature, regardless of type. Returns validity & detected crypto type.cryptoIsReady (): boolean
function to check status of initializationaddressCheckChecksum (decoded: Uint8Array)
as an helper to extract and verify the ss58 checksum*.d.ts
files now contain TypeScript 3.8 features, #private
, which is not usable in older versionsChanges:
isBigInt(value)
to allow BigInt
checks. Also add support in bnToBn
as well as number conversion utilsisChildClass(Parent, Child?)
to check if a class extends the parent, asserting Child is Parent#<field>
instead of private _<field>
for private class variablesChanges:
formatBalance
does not apply unit overrides apply when no SI is applicableformatBalance(<balance>, <options>)
to take expanded withUnit: string | boolean
option where string is an actual unit, e.g. KSM
decimals
option to formatBalance
should now be passed as part of the options
(previous last-param deprecated).setSS58Format
on keyring will now just operate on pairs created on the keyring, not globally. The global setSS58Format
in @polkadot/util-crypto
will be deprecated.addressPrefix
option to keyring has been belatedly removed (Use ss58Format
rather)Contributed:
formatDate
function (Thanks to https://github.com/AndreasGassmann)@types/*
to dev deps (Thanks to https://github.com/AndreasGassmann)Changes:
@polkadot/wasm-crypto
1.0Changes:
Changes:
detectPackage(<package.json>, __dirname?)
with calling folderChanges:
chainspec
, db
, trie-codec
, trie-db
and trie-hash
packages (moved to client)assertSingletonPackage
to detectPackage
with inclusion of version listingContributed:
Changes:
formatBalance
signature now allows to force unit displayspair.derive(...)
assert
now acts like a real asserts, with no return - signature adapted for new TS 3.7Changes:
pair.sign(message)
now takes an optional second options?: SignOptions
parameter, where SignOptions
is currently defined as { withType: boolean }
. Here withType
instructs the signing to prepend the type of signature (ed2551, sr25519 or ecdsa). This is used for the new Polkadot/Substrate MultiSignature format.Changes:
ss58Format
, you should now use setSS58Format
as opposed to the old setAddressPrefix
Changes:
keyring.setAddressPrefix
to keyring.setSS58Format
addressPrefix
on the keyring options, added the ss58Format
as a replacement (aligning with chain properties - the old version is still accepted)stringToHex
and hexToString
conversion utilities to @polkadot/util
Changes:
ExtError
class, always prefer the standard JS Error
object for errors. This would bre a breaking change for any applications using ExtError
Changes:
addFromAddress
can now be used to store external accounts, for example those provided by external signersChanges:
assertSingletonPackage
now 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:
formatBalance
now allows for Compact
inputsformaBalance
now allows correct formatting of very large decimalsChanges:
checkAddress(address, prefix)
to @polkadot/util-crypto
that validates an ss-58 addressasm.js
fallback for the React Native environment (via @polkadot/wasm-crypto
)Changes:
getMeta
use the meta
getter, i.e. console.log(pair.meta.name)
address
use the address
getter, i.e. console.log(pair.address)
publicKey
use the publicKey
getter, i.e. console.log(pair.publicKey)
Move decodeAddress
, encodeAddress
& setAddressPrefix
functions into @polkadot/util-crypto
from @polkadot/keyring
. External interfaces should not be affected at this point since it is also (still) exported and exposed on keyringChanges:
formatBalance
formatBalance
, formatDecimal
& formatNumber
to cater for negative numbersChanges:
@polkadot/wasm
to include a maintenance bump for the w3f/schnorrkel
librariesChanges:
Changes:
addFromMnemonic
to generate using new-style derivation.formatBalance
, formatDecimal
, formatElapsed
, formatNumber
, calcSi
, findSi
& isTestChain
utility functions from the originals in @polkadot/ui-util
wasm-schnorrkel
& wasm-ed25519
for combined version with wasm-crypto
transactionAsync
(client-only changes)Changes:
Changes:
assertSingletonPackage
to utilChanges:
Changes:
Changes:
@poladkot/wasm-crypto
with a fallback to the pure JS versionsChanges:
Changes:
Changes:
fromUri
to keyring along with hard & soft key derivation.Changes:
syncify
function, not exported by the package (with binary dependency for Node)Changes:
ed25519
or sr25519
string to denote the type, i.e. new Keyring({ type: 'sr25519' })