-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(hd-wallet): add package #1151
Conversation
🦋 Changeset detectedLatest commit: e041095 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Ignored Deployments
|
@@ -0,0 +1,53 @@ | |||
# Use BIP44 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe somewhere in this decision record, you could also mention something about not supporting extended-public-keys
@@ -8360,8 +8362,8 @@ if (debugUtil && debugUtil.debuglog) { | |||
} | |||
/*</replacement>*/ | |||
|
|||
var BufferList = require('./internal/streams/BufferList.js'); | |||
var destroyImpl = require('./internal/streams/destroy.js'); | |||
var BufferList = require('./internal/streams/BufferList'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if it matters, but potentially the removal of .js
makes this extraction esm
incompatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this bundle is created with browserify, I have copied it from the old lib.
it only work if I remove .js
actually I didnt add them manually my VSCode did it when I move the file to the different path.
I will check esm
compatibility
.gitignore
Outdated
packages/tools/lint-package/src/helpers.js | ||
packages/tools/lint-package/src/index.js | ||
packages/tools/lint-package/src/logger.js | ||
packages/tools/lint-package/src/rules/api-extractor/types.js | ||
packages/tools/lint-package/src/rules/eslint/config.js | ||
packages/tools/lint-package/src/rules/package-json/scripts.js | ||
packages/tools/lint-package/src/rules/typescript/extends.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to make a separate PR for this?
Is this happening when running tsc
in that package? It should, based on tsconfig, create a lib
for files like this.
Do we maybe need a more generic one? Something like
packages/*/*/src/**/*.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how they came up here
packages/libs/hd-wallet/.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this file?
"lib" | ||
], | ||
"scripts": { | ||
"build": "tsc && cpy ./src/chainweaver/vendor/**/* ./lib/chainweaver/vendor/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add api-extractor to this package?
"name": "@kadena/hd-wallet", | ||
"version": "0.0.1", | ||
"private": true, | ||
"description": "HD Wallet; key derivation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "HD Wallet; key derivation", | |
"description": "A common approach to work with mnemonic keys and key derivation for Kadena based on BIP39 BIP44", |
packages/libs/hd-wallet/src/index.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this generic for the other non-legacy/chainweaver implementation as well?
"extends": "./node_modules/@kadena-dev/shared-config/tsconfig-base.json", | ||
"compilerOptions": { | ||
"allowJs": false, | ||
"lib": ["es2019", "DOM"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to not rely on DOM? Do you think that using DOM
here will make this package potentially not work in non-DOM, nodejs, environment?
export declare const kadenaSign: ( | ||
password: string, | ||
message: string, | ||
privateKey: string, | ||
) => Uint8Array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to use the rootKey
and
do we want to be signing multiple hashes at once to improve performance?
export declare const kadenaSign: ( | |
password: string, | |
message: string, | |
privateKey: string, | |
) => Uint8Array; | |
export declare const kadenaSign: ( | |
password: string, | |
rootKey: string | Uint8Array, | |
index: number, | |
...message: string[] | |
) => Uint8Array; |
|
||
export declare const kadenaGenMnemonic: () => string; | ||
|
||
export declare const kadenaGetPublic: (secretKey: Uint8Array) => Uint8Array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should probably accept the rootKey: string | Uint8Array
, password: string
, ...index: number[]
This is the first PR related to hd-wallet
check readme and ADRs for more information