-
Notifications
You must be signed in to change notification settings - Fork 89
feat: implement starknet for native #774
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
6a2302a
chore: version packages to 1.62.32-starknet.0
NeOMakinG dca2f76
fix: cleanup shit
gomesalexandre 1917f29
fix: restore starknet dependencies to hdwallet-native
gomesalexandre 6c6b329
chore: version packages to 1.62.33-starknet.0
gomesalexandre 45b0493
fix: ci
gomesalexandre deb8f8e
[skip ci] wip: skip ci
gomesalexandre 87270a8
fix: ci
gomesalexandre a2ce8d8
chore: version packages to 1.62.33-starknet.1
gomesalexandre 9522d96
fix: sig length
gomesalexandre d2979c0
feat: don't pollute bip32 node
gomesalexandre 43949d3
chore: version packages to 1.62.33-starknet.2
gomesalexandre 601c369
feat: add comprehensive logging for starknet debugging
gomesalexandre 95aff1c
chore: version packages to 1.62.33-starknet.3
gomesalexandre 754eee5
fix: make starkMasterKey optional in initialize
gomesalexandre 9b8ee2b
chore: version packages to 1.62.33-starknet.4
gomesalexandre 41c6e7a
feat: add initialization logging
gomesalexandre 1a84c9b
chore: version packages to 1.62.33-starknet.5
gomesalexandre e71eaa3
fix: stark master key initialization in constructor
gomesalexandre 63b360d
chore: version packages to 1.62.33-starknet.6
gomesalexandre cd03b76
chore: version packages to 1.62.33-starknet.6
gomesalexandre 2d43148
fix: add stark master key to loadDevice
gomesalexandre 81966c7
chore: version packages to 1.62.33-starknet.8
gomesalexandre 1a2fc8c
fix: support non-hardened derivation in stark engine
gomesalexandre 6f8d24e
chore: version packages to 1.62.33-starknet.9
gomesalexandre ae0cfa5
fix: compute actual contract address instead of returning public key
gomesalexandre e3d0a98
chore: version packages to 1.62.33-starknet.10
gomesalexandre dce57a5
docs: add STARK curve and Starknet spec references
gomesalexandre 746cf06
docs: add comprehensive Stark curve documentation and references
gomesalexandre 48b924f
docs: add comments explaining Stark master key in bip32, dummy, and a…
gomesalexandre bac3fa7
refactor: clean up debugging logs and move stark init back to Promise…
gomesalexandre fb79a67
fix: pad Starknet public keys to 64 hex chars
gomesalexandre ef327d7
chore: version packages to 1.62.33-starknet.11
gomesalexandre 6b84173
fix: pad contract address to 64 hex chars
gomesalexandre b44b240
chore: version packages to 1.62.33-starknet.12
gomesalexandre 4dc33a9
chore: remove debug logging
gomesalexandre 11f947d
chore: version packages to 1.62.33-starknet.13
gomesalexandre 7be85cb
chore: version packages to 1.62.33-starknet.14
gomesalexandre 8feaab6
chore: revert versions to 1.62.32 and use npmjs registry
gomesalexandre bf77265
fix: remove carets from 1.62.32 versions (should be exact)
gomesalexandre 2a80641
chore: pin all dependency versions across all packages
gomesalexandre cfb2b6a
feat: clean shit up
gomesalexandre ffafa43
fix: uh oh
gomesalexandre c1b54f1
fix: add starkMasterKey to native wallet tests
gomesalexandre 2b1c409
style: format loadDevice calls in native tests
gomesalexandre 2c1b669
chore(release): publish 1.62.33
gomesalexandre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,17 @@ | ||
| { | ||
| "lerna": "5.2.0", | ||
| "version": "1.62.32", | ||
| "version": "1.62.33-starknet.0", | ||
| "npmClient": "yarn", | ||
| "useWorkspaces": true, | ||
| "command": { | ||
| "publish": { | ||
| "message": "chore(release): publish %v" | ||
| } | ||
| }, | ||
| "ignoreChanges": ["**/__fixtures__/**", "**/__tests__/**", "**/*.md", "**/.env"] | ||
| "ignoreChanges": [ | ||
| "**/__fixtures__/**", | ||
| "**/__tests__/**", | ||
| "**/*.md", | ||
| "**/.env" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { addressNListToBIP32, slip44ByCoin } from "./utils"; | ||
| import { BIP32Path, HDWallet, HDWalletInfo, PathDescription } from "./wallet"; | ||
|
|
||
| export interface StarknetGetAddress { | ||
| addressNList: BIP32Path; | ||
| showDisplay?: boolean; | ||
| } | ||
|
|
||
| export interface StarknetSignTx { | ||
| addressNList: BIP32Path; | ||
| txHash: string; | ||
| } | ||
|
|
||
| export interface StarknetSignedTx { | ||
| signature: string[]; | ||
| } | ||
|
|
||
| export interface StarknetGetAccountPaths { | ||
| accountIdx: number; | ||
| } | ||
|
|
||
| export interface StarknetAccountPath { | ||
| addressNList: BIP32Path; | ||
| } | ||
|
|
||
| export interface StarknetWalletInfo extends HDWalletInfo { | ||
| readonly _supportsStarknetInfo: boolean; | ||
|
|
||
| starknetGetAccountPaths(msg: StarknetGetAccountPaths): Array<StarknetAccountPath>; | ||
| starknetNextAccountPath(msg: StarknetAccountPath): StarknetAccountPath | undefined; | ||
| } | ||
|
|
||
| export interface StarknetWallet extends StarknetWalletInfo, HDWallet { | ||
| readonly _supportsStarknet: boolean; | ||
|
|
||
| starknetGetAddress(msg: StarknetGetAddress): Promise<string | null>; | ||
| starknetSignTx(msg: StarknetSignTx): Promise<StarknetSignedTx | null>; | ||
| } | ||
|
|
||
| export function starknetDescribePath(path: BIP32Path): PathDescription { | ||
| const pathStr = addressNListToBIP32(path); | ||
| const unknown: PathDescription = { | ||
| verbose: pathStr, | ||
| coin: "Starknet", | ||
| isKnown: false, | ||
| }; | ||
|
|
||
| if (path.length != 5) return unknown; | ||
| if (path[0] != 0x80000000 + 44) return unknown; | ||
| if (path[1] != 0x80000000 + slip44ByCoin("Starknet")) return unknown; | ||
| if ((path[2] & 0x80000000) >>> 0 !== 0x80000000) return unknown; | ||
| if (path[3] !== 0) return unknown; | ||
| if (path[4] !== 0) return unknown; | ||
|
|
||
| const index = path[2] & 0x7fffffff; | ||
| return { | ||
| verbose: `Starknet Account #${index}`, | ||
| accountIdx: index, | ||
| wholeAccount: true, | ||
| coin: "Starknet", | ||
| isKnown: true, | ||
| }; | ||
| } | ||
|
|
||
| export function starknetGetAccountPaths(msg: StarknetGetAccountPaths): Array<StarknetAccountPath> { | ||
| const slip44 = slip44ByCoin("Starknet"); | ||
| return [{ addressNList: [0x80000000 + 44, 0x80000000 + slip44, 0x80000000 + msg.accountIdx, 0, 0] }]; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.