This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb5d886
commit d8ca456
Showing
89 changed files
with
8,245 additions
and
3,606 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -76,3 +76,8 @@ reports | |
*.patch | ||
.diff/ | ||
.patch/ | ||
|
||
# IDEA IDE | ||
.idea | ||
|
||
temp |
This file contains 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,10 @@ | ||
#!/bin/sh | ||
|
||
find ../../modules/node_modules/@colony/purser-core/ -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | ||
|
||
|
||
find purser-ledger/ -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | ||
|
||
find purser-software/ -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | ||
find purser-trezor/ -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | ||
|
This file contains 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,74 @@ | ||
|
||
# Migrating purser from flow-js to typescript | ||
|
||
this is a small diary of the migration process from flow to typescript | ||
|
||
|
||
Done with the help of this tutorial: | ||
https://medium.com/inato/migrating-from-flow-to-typescript-why-how-worth-it-5b7703d12089 | ||
|
||
|
||
Current Strategy: Start with purser-core and then digging forward to other modules. | ||
|
||
|
||
## typescript config changes | ||
|
||
### dom Modules | ||
the dom module was required for using the crypto functionality of windows | ||
(Maybe it could be bypassed by using hashtable accessor (this['window'] instead of this.window)) | ||
|
||
### esModuleInterop flag | ||
esModuleInterop is required for the BN.js library. see: https://github.com/CodeChain-io/codechain-primitives-js/issues/68 | ||
|
||
|
||
### Internal references | ||
|
||
used to be `@colony/purser-core` - now they are `../purser-core`. | ||
need to figure out how to do better. | ||
|
||
|
||
## Known Issues | ||
|
||
### Removed Functionality | ||
|
||
- removed eslint for now, going to reactivate proper linting for TS later on. | ||
- genericWallet `otherAddresses` property and in the constructor ?? added again ?! TODO: check. | ||
|
||
|
||
## Possible Improvements | ||
|
||
## TransactionObjectType | ||
|
||
maybe TransactionObjectType could be replaced with the less restrictive eth-core type TransactionConfig, | ||
|
||
´´´ | ||
export interface TransactionConfig { | ||
from?: string | number; | ||
to?: string; | ||
value?: number | string | BN; | ||
gas?: number | string; | ||
gasPrice?: number | string | BN; | ||
data?: string; | ||
nonce?: number; | ||
chainId?: number; | ||
} | ||
´´´ | ||
|
||
### purser-software | ||
removed the setter purser-software keystore. | ||
|
||
set keystore(newEncryptionPassword: string): void { | ||
internalEncryptionPassword = newEncryptionPassword; | ||
} | ||
|
||
#### Private Key is passed forward as Buffer | ||
see privateKeyBuffer, ethereum-js privateToPublic works only with buffers. | ||
|
||
#### Private Key from Mnemonic | ||
|
||
SoftwareWallet requires `WalletArgumentsType` as construction argument. | ||
In the old implementation an | ||
|
||
|
||
## Should be tested | ||
- support for msCrypto (Edge browser) |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.