Skip to content
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

Refactor: dependencies dedup (such as keccaak, bip, etc) #139

Merged
merged 29 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4550b29
test: add bls regression tests
nicolasbrugneaux Feb 29, 2024
23e51e8
refactor: more deps gone
nicolasbrugneaux Feb 13, 2024
05e6849
refactor: types
nicolasbrugneaux Feb 14, 2024
95709ce
refactor: getWordList
nicolasbrugneaux Feb 14, 2024
9088c70
refactor: more deps gone
nicolasbrugneaux Feb 15, 2024
a856fe8
fix: utils
nicolasbrugneaux Feb 15, 2024
bbc94f4
fix: keccak hash
nicolasbrugneaux Feb 15, 2024
176bc6f
fix: various buffer fixes
nicolasbrugneaux Feb 16, 2024
2cb0609
fix: force keccak to consider string as bytes
nicolasbrugneaux Feb 16, 2024
9248396
chore: update docs
nicolasbrugneaux Feb 16, 2024
bf41ef8
fix: type
nicolasbrugneaux Feb 23, 2024
d9f7dc9
refactor: rlp -> @ethereumjs/rlp
nicolasbrugneaux Feb 23, 2024
3cbd0d3
refactor: eth-lib removal wip
nicolasbrugneaux Feb 23, 2024
7985685
refactor: eth-lib removal
nicolasbrugneaux Feb 23, 2024
a3b52a4
chore: regenerate docs
nicolasbrugneaux Feb 23, 2024
b83dcb5
fix: ensure no 0x-prefixed string is passed to hextobytes
nicolasbrugneaux Feb 26, 2024
00e6f77
fix: update snapshot
nicolasbrugneaux Feb 26, 2024
6f8f7d7
fix: ensure r,s,v are 0x prefixed
nicolasbrugneaux Feb 26, 2024
7f854ca
chore: regenerate docs
nicolasbrugneaux Feb 26, 2024
357858d
test: bls
nicolasbrugneaux Feb 29, 2024
af2d4e9
test: some more signing-utils tests
nicolasbrugneaux Feb 29, 2024
81ff587
chore: regenerate docs
nicolasbrugneaux Mar 1, 2024
0195914
Merge branch 'elliptic-more-like-byelliptic' into chore/bip-to-scure
nicolasbrugneaux Mar 26, 2024
91f52be
chore: regenerate docs
nicolasbrugneaux Mar 26, 2024
101e962
fix: web3 resolution
nicolasbrugneaux Mar 27, 2024
d483aaa
fix: ledger SignMessage
nicolasbrugneaux Mar 27, 2024
e811580
chore: add note
nicolasbrugneaux Mar 27, 2024
f88d04a
chore: regenerate docs
nicolasbrugneaux Mar 27, 2024
2a28bac
Merge branch 'elliptic-more-like-byelliptic' into chore/bip-to-scure
nicolasbrugneaux Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
},
"resolutions": {
"ganache": "npm:@celo/[email protected]",
"bip39": "https://github.com/bitcoinjs/bip39#a7ecbfe2e60d0214ce17163d610cad9f7b23140c",
"blind-threshold-bls": "npm:@celo/[email protected]",
"@types/bn.js": "4.11.6",
"bignumber.js": "9.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"@oclif/plugin-not-found": "^3.0.9",
"@oclif/plugin-plugins": "^4.1.17",
"@oclif/plugin-warn-if-update-available": "^3.0.9",
"@scure/bip32": "^1.3.3",
"@types/command-exists": "^1.2.3",
"bignumber.js": "9.0.0",
"bip32": "3.1.0",
"chalk": "^2.4.2",
"command-exists": "^1.2.9",
"cross-fetch": "3.1.5",
Expand Down
12 changes: 6 additions & 6 deletions packages/docs/sdk/docs/base/interfaces/account.Bip39.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ ___

### mnemonicToSeed

• **mnemonicToSeed**: (`mnemonic`: `string`, `password?`: `string`) => `Promise`\<`Buffer`\>
• **mnemonicToSeed**: (`mnemonic`: `string`, `password?`: `string`) => `Promise`\<`Uint8Array`\>

#### Type declaration

▸ (`mnemonic`, `password?`): `Promise`\<`Buffer`\>
▸ (`mnemonic`, `password?`): `Promise`\<`Uint8Array`\>

##### Parameters

Expand All @@ -58,7 +58,7 @@ ___

##### Returns

`Promise`\<`Buffer`\>
`Promise`\<`Uint8Array`\>

#### Defined in

Expand All @@ -68,11 +68,11 @@ ___

### mnemonicToSeedSync

• **mnemonicToSeedSync**: (`mnemonic`: `string`, `password?`: `string`) => `Buffer`
• **mnemonicToSeedSync**: (`mnemonic`: `string`, `password?`: `string`) => `Uint8Array`

#### Type declaration

▸ (`mnemonic`, `password?`): `Buffer`
▸ (`mnemonic`, `password?`): `Uint8Array`

##### Parameters

Expand All @@ -83,7 +83,7 @@ ___

##### Returns

`Buffer`
`Uint8Array`

#### Defined in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ ___

### mnemonicToSeed

• **mnemonicToSeed**: (`mnemonic`: `string`, `password?`: `string`) => `Promise`\<`Buffer`\>
• **mnemonicToSeed**: (`mnemonic`: `string`, `password?`: `string`) => `Promise`\<`Uint8Array`\>

#### Type declaration

▸ (`mnemonic`, `password?`): `Promise`\<`Buffer`\>
▸ (`mnemonic`, `password?`): `Promise`\<`Uint8Array`\>

##### Parameters

Expand All @@ -58,7 +58,7 @@ ___

##### Returns

`Promise`\<`Buffer`\>
`Promise`\<`Uint8Array`\>

#### Defined in

Expand All @@ -68,11 +68,11 @@ ___

### mnemonicToSeedSync

• **mnemonicToSeedSync**: (`mnemonic`: `string`, `password?`: `string`) => `Buffer`
• **mnemonicToSeedSync**: (`mnemonic`: `string`, `password?`: `string`) => `Uint8Array`

#### Type declaration

▸ (`mnemonic`, `password?`): `Buffer`
▸ (`mnemonic`, `password?`): `Uint8Array`

##### Parameters

Expand All @@ -83,7 +83,7 @@ ___

##### Returns

`Buffer`
`Uint8Array`

#### Defined in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L16)
[cryptographic-utils/src/commentEncryption.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L17)

___

Expand All @@ -29,4 +29,4 @@ ___

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L15)
[cryptographic-utils/src/commentEncryption.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L16)
1 change: 1 addition & 0 deletions packages/docs/sdk/docs/cryptographic-utils/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
- [dataEncryptionKey](modules/dataEncryptionKey.md)
- [index](modules/index.md)
- [types](modules/types.md)
- [wordlists](modules/wordlists.md)
49 changes: 35 additions & 14 deletions packages/docs/sdk/docs/cryptographic-utils/modules/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [generateMnemonic](account.md#generatemnemonic)
- [generateSeed](account.md#generateseed)
- [getAllLanguages](account.md#getalllanguages)
- [getWordList](account.md#getwordlist)
- [invalidMnemonicWords](account.md#invalidmnemonicwords)
- [mnemonicLengthFromStrength](account.md#mnemoniclengthfromstrength)
- [normalizeMnemonic](account.md#normalizemnemonic)
Expand Down Expand Up @@ -85,7 +86,7 @@ base/lib/account.d.ts:18

#### Defined in

[cryptographic-utils/src/account.ts:465](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L465)
[cryptographic-utils/src/account.ts:455](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L455)

___

Expand Down Expand Up @@ -125,7 +126,7 @@ malformed. It may occasionally occur that a typo results in word from another la

#### Defined in

[cryptographic-utils/src/account.ts:233](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L233)
[cryptographic-utils/src/account.ts:220](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L220)

___

Expand All @@ -149,7 +150,7 @@ now an alias for normalizeMnemonic.

#### Defined in

[cryptographic-utils/src/account.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L159)
[cryptographic-utils/src/account.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L166)

___

Expand Down Expand Up @@ -178,7 +179,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:416](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L416)
[cryptographic-utils/src/account.ts:403](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L403)

___

Expand All @@ -203,7 +204,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:403](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L403)
[cryptographic-utils/src/account.ts:390](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L390)

___

Expand Down Expand Up @@ -232,7 +233,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:444](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L444)
[cryptographic-utils/src/account.ts:431](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L431)

___

Expand All @@ -254,7 +255,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L54)
[cryptographic-utils/src/account.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L61)

___

Expand All @@ -277,7 +278,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:429](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L429)
[cryptographic-utils/src/account.ts:416](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L416)

___

Expand All @@ -291,7 +292,27 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:188](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L188)
[cryptographic-utils/src/account.ts:175](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L175)

___

### getWordList

▸ **getWordList**(`language?`): `string`[]

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `language` | [`MnemonicLanguages`](../enums/account.MnemonicLanguages.md) | `MnemonicLanguages.english` |

#### Returns

`string`[]

#### Defined in

[cryptographic-utils/src/account.ts:171](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L171)

___

Expand Down Expand Up @@ -320,7 +341,7 @@ invalid, or half of the valid words are from one language and the other half fro

#### Defined in

[cryptographic-utils/src/account.ts:88](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L88)
[cryptographic-utils/src/account.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L95)

___

Expand All @@ -340,7 +361,7 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:202](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L202)
[cryptographic-utils/src/account.ts:189](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L189)

___

Expand Down Expand Up @@ -369,7 +390,7 @@ that all the words in the phrase are contained in a valid wordlist.

#### Defined in

[cryptographic-utils/src/account.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L109)
[cryptographic-utils/src/account.ts:116](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L116)

___

Expand Down Expand Up @@ -410,7 +431,7 @@ It is recommended to normalize the mnemonic phrase before inputting to this func

#### Defined in

[cryptographic-utils/src/account.ts:288](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L288)
[cryptographic-utils/src/account.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L275)

___

Expand All @@ -432,4 +453,4 @@ ___

#### Defined in

[cryptographic-utils/src/account.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L62)
[cryptographic-utils/src/account.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/account.ts#L69)
14 changes: 7 additions & 7 deletions packages/docs/sdk/docs/cryptographic-utils/modules/bls.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#### Defined in

[cryptographic-utils/src/bls.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L12)
[cryptographic-utils/src/bls.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L11)

___

Expand All @@ -33,13 +33,13 @@ ___

#### Defined in

[cryptographic-utils/src/bls.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L11)
[cryptographic-utils/src/bls.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L10)

## Functions

### blsPrivateKeyToProcessedPrivateKey

▸ **blsPrivateKeyToProcessedPrivateKey**(`privateKeyHex`): `any`
▸ **blsPrivateKeyToProcessedPrivateKey**(`privateKeyHex`): `Buffer`

#### Parameters

Expand All @@ -49,11 +49,11 @@ ___

#### Returns

`any`
`Buffer`

#### Defined in

[cryptographic-utils/src/bls.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L14)
[cryptographic-utils/src/bls.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L13)

___

Expand All @@ -74,7 +74,7 @@ ___

#### Defined in

[cryptographic-utils/src/bls.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L53)
[cryptographic-utils/src/bls.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L51)

___

Expand All @@ -94,4 +94,4 @@ ___

#### Defined in

[cryptographic-utils/src/bls.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L48)
[cryptographic-utils/src/bls.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/bls.ts#L46)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L115)
[cryptographic-utils/src/commentEncryption.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L119)

## Functions

Expand All @@ -61,7 +61,7 @@ Decrypted comment if can decrypt, otherwise comment.

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:104](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L104)
[cryptographic-utils/src/commentEncryption.ts:108](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L108)

___

Expand All @@ -87,7 +87,7 @@ Decrypted data.

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L45)
[cryptographic-utils/src/commentEncryption.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L46)

___

Expand Down Expand Up @@ -115,7 +115,7 @@ base64 string of encrypted comment if can encrypt, otherwise comment.

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L69)
[cryptographic-utils/src/commentEncryption.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L73)

___

Expand All @@ -141,4 +141,4 @@ Encrypted data to sender and recipient.

#### Defined in

[cryptographic-utils/src/commentEncryption.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L27)
[cryptographic-utils/src/commentEncryption.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/cryptographic-utils/src/commentEncryption.ts#L28)
Loading
Loading