Commit Graph
45 Commits
Author SHA1 Message Date
Jaco 6ba45086b5 Move type-only imports (w/ verbatimModuleSyntax) (#1790) 2023-04-02 09:53:43 +03:00
Jaco 45b040fbf8 Additional __PURE__ annotations (#1787)
* Additional __PURE__ annotations

* Revert as const (This _could_ yield breaking external changes)
2023-03-31 08:08:01 +03:00
Jaco 211af1f999 Bump dev deps (#1767) 2023-03-17 07:22:49 +02:00
Jaco 79593b0a70 Bump dev (#1766)
* Bump dev

* Change ref types
2023-03-15 17:06:07 +02:00
Jaco 3fd61e678a Bump dev (#1761)
* Bump dev

* Adjust dev/node/test/node.d.ts imports

* Adjust extensionless import

* Additional adjustments
2023-03-12 12:01:35 +02:00
Jaco 9c224f5076 Use .js imports in src (#1756)
* Use .js imports in src

* Revert node/test/node -> node/test/node.d.ts (for now)

* util-crypto

* Additional

* Adjust tsconfig aliases

* Bump dev
2023-03-09 11:04:03 +02:00
Jaco 0b85a4d5e2 Bump dev deps (#1755) 2023-03-06 14:17:56 +02:00
Jaco 3e2c3a6ed8 Move test cryptoWaitReady top-level (#1747)
* Move test cryptoWaitReady top-level

* Add missing mod.ts

* Revert mod.ts add

* Add types reference for tests

* Adjust

* adjust

* node:fs & node:path
2023-02-25 11:13:51 +02:00
Jaco 3fe6be655d Update headers for 2023 (#1697) 2023-01-01 10:21:43 +02:00
Jaco c08c947abf Convert assert to if + throw (remaining occurences) (#1622)
* Convert assert to if + throw (remaining occurences)

* Adjust for readability

* CHANGELOG
2022-08-04 10:45:10 +03:00
Jaco 0f0b243815 Adjust isNull & isUndefined checks (#1554) 2022-06-20 17:06:35 +03:00
Jaco 9ae4b1066e Change all occurences of .substr(...) to .substring(...) (#1479) 2022-05-09 12:50:13 +03:00
Jaco 3597a4eb4e 2022 (#1346) 2022-01-01 09:26:11 +02:00
Jaco b16396b9b3 Rename internal keypair locations (#1242)
* Rename internal keypair locations

* save all :)

* Incdicate testing

* add dummy test
2021-11-25 12:17:23 +02:00
Jaco be8cabbd1e Rename {ed, sr}25519 functions (#1237)
* Rename {ed, sr}25519 functions

* Finalize renames

* Fix wasm imports

* CHANGELOG
2021-11-24 15:21:28 +02:00
Jaco ba0a183bd9 Re-use pre-define BN_{BE, LE}_* constants (#1175)
* Re-use pre-define BN_{BE, LE}_* constants

* ordering update

* bnMax/bnMin opt

* u8aToHex flatten
2021-11-12 09:19:49 +02:00
Jaco a4cefa4bfc Adjust base library usage of for vs reduce/map (#1151)
* Adjust base library usage of `for` vs `reduce/map`

* Additional

* Adjust
2021-10-31 08:27:14 +02:00
Jaco 93d5041e8f Adjust base* validation function (#1139)
* Adjust base* validation function

* Adjust sr25519 derive functions

* More dedupe

* Rename

* Adjust
2021-10-23 13:11:58 +03:00
Jaco 1bcafead57 Parse derivation paths via BN (#1130)
* Parse derivation paths via BN

* Direct to u8a for numbers

* CHANGELOG
2021-10-14 09:34:13 +03:00
Jaco 9fc57a23e8 Adjust isHex with template return (#1103)
* Adjust isHex with template return

* Unneeded assignment

* CHANGELOG

* typo

* Additional HexString types

* Additional HexString inputs

* Use U8aLike as applicable

* typo

* Unneeded type

* HexString outputs

* Export types
2021-09-08 14:38:53 +02:00
Nantian 2e4de2093c fix bigint type (#1079) 2021-08-12 10:00:58 +02:00
Jaco 0ef761e899 User template string type for isHex (#1020)
* User template string type for isHex

* isHex/isString combo checks
2021-06-22 16:05:14 +02:00
Jaco f2d611e26d BN util export (& imports adjust) (#1009)
* BN util export (& imports adjust)

* Fix hexToBn

* Adjusts test

* Move bn export
2021-06-11 11:42:29 +02:00
Jaco bbadfbebfa assert cleanups (#957) 2021-04-22 13:13:41 +02:00
Antoine EstienneandJaco Greeff c46cd5030e Implement first eth hd derivation test (#858)
* implement first eth hd test

* lint

* added gerald test address

* test now passes

* started implementing sith local secp256k1

* Pass publicKey through on verify

* Some test fixes

* renamed tweakadd

* added suggestions

* remove logs and complete test for tweakAdd

* lint

* reviewed

* solve linting problems

* relocate hd package

* Apply suggestions from code review

Co-authored-by: Jaco Greeff <jacogr@gmail.com>

* added asset for tolegacyseed

* yarn.lock and linting

* remove isUint8 util

* fix tests and added tests

* fixed test

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2021-02-24 15:50:12 +01:00
Jaco Greeff f0f0dec8ea 2021 (#824) 2021-01-03 11:20:22 +01:00
Jaco Greeff b1a40516c1 Bump dev (import sorting) (#789) 2020-12-07 16:13:47 +01:00
Jaco Greeff af71673c7b import type (#782) 2020-12-01 13:24:37 +01:00
Jaco Greeff f07d66562b Remove default exports (#755)
* Remove default exports

* Cleanup tests

* Exports in util

* Single secp256k1 instance

* Length check

* format check

* encoded lengths
2020-11-08 18:07:31 +01:00
Jaco Greeff 56a79924a0 SPDX (#687) 2020-09-17 16:13:39 +02:00
Jaco Greeff d352782927 Ethereum keypair support (#661)
* Ethereum keypair support

* keypair support from seed

* Signature verification

* Cleanups

* Cleanup encode (no extra toLower)

* u8aToU8a

* Simulate random failure with range

* Cleanup BN conversions
2020-08-14 12:41:56 +02:00
Brad Larson a0251ff650 [FIX] Adjust error message (#646)
I ran into a case where the secret value provided had trailing
whitespace, and when the code ran, it logged that secret value as part
of the stack trace.

This change will make it harder for users to accidentally leak key
material.
2020-07-31 15:48:31 +02:00
Jaco Greeff bdb14f91a8 Pre-checks on verify input lengths (#608)
* Pre-checks on verify input lengths

* Small cleanup

* Update error signatures
2020-06-01 10:27:08 +02:00
Jaco Greeff 6de6b871cd Adjust DeriveJunction (types & BigInt) (#598) 2020-05-11 13:57:59 +02:00
Alexander Krupenkin 34380caf1f Added ECDSA keypair support (#589)
* Added ECDSA signature verification

* Add ECDSA keypair, sign, key derivation, fromSeed and tests

* keyring: added ECDSA keypair

* Fix lint errors
2020-04-30 00:33:10 +02:00
Jaco Greeff 7c1ca3a5c9 Use #<varname> instead of private _<varname> (#545)
* Use #<varname> insead of private _<varname>

* Update key extraction paths
2020-02-22 14:45:31 +01:00
Jaco Greeff 241febb707 Bump deps (#497) 2020-01-06 13:43:49 +01:00
Jaco Greeff 25fc033728 typescript-eslint 2 (#462)
* typescript-eslint 2

* startsWith fixes

* padStart/padEnd
2019-08-30 12:24:16 +02:00
Jaco Greeff 80db504a3b Swap to using eslint (#435)
* WIP

* ... and more

* yet more...

* and examples (more-or-less) fixed

* Only problematic promisify left...

* Last batch

* rm config header

* Update

* Use Record

* Bumps
2019-07-14 11:12:46 +02:00
Jaco Greeff 828688bd10 Cater for non-slash derived paths (#377) 2019-03-21 11:48:08 +01:00
Jaco Greeff f6d05e0553 Utility function to extract from path only (#376)
* Utility function to extract from path only

* Add createFromUri
2019-03-21 10:51:02 +01:00
Jaco Greeff 5dc8e87797 Hard and soft derivation aligned with substrate master (#369)
* I compiles... ship it!?

* Re-enable derivation from path tests

* Update schnorrkel-js (latest w3f version)

* Swap default keyring to sr25519
2019-03-16 11:34:31 +01:00
Jaco Greeff 6049f09880 Dev keys should use sr25519 derivation (#361)
* Dev keys should use sr25510 derivation

* Rework derive

* Derive hard and soft

* Swap default to isDerived

* typo

* Pull in new schnorrkel-js dep, update tests

* Update nobody
2019-03-14 16:10:38 +01:00
Jaco Greeff de67a88f45 Remove /index imports (swap to bare) (#362) 2019-03-14 08:41:00 +01:00
Jaco Greeff f1ca4eef0e Introduce key suri (path derivation) (#358)
* Introduce key suri (path derivation)

* Errant console.log

* let -> const

* Add seed derivation from path

* Allow new-generation derivation

* Add addFromUri to keyring

* Use addFromUri in testing keyring

* Add suri tests

* Prepare for sr25519 derivation

* CHANGELOG entry

* ed25519 is aligned with substrate

* Bump version
2019-03-13 14:39:10 +01:00