monero-ts
monero-ts copied to clipboard
Add support for typescript via type definitions in @types folder.
Add support for typescript via type definitions in @types folder.
Install typescript, emit typedefs, and "fix" index.d.ts.
Replace all BigInteger math function calls with standard BigInt...
... overloads (BigInteger(value).multiply(BigInteger(value2)) -> BigInt(value) * BigInt(value2))
Type nearly everything in TestSampleCode.ts.
Fix all errors that were due to typing vars in "for...of" statements.
NOTE: keyImage is defined as string. This is probably correct but can't be verified due to lack of documentation and my inability to trace the method chain in the source code.
Intermediate progress writing script to replace BigInteger.compare.
Find lefthand terms of .compare operations.
Replacing BigInteger.compare() with BigIntegerCompare() in progress.
Fix all errors and finish converting TestSampleCode.js to Typescript.
Update "async" to version 2.6.4.
This was a messy, messy merge/rebase. Please take a good look at the diffs to make sure nothing screwy is going on.
Related issue: https://github.com/monero-ecosystem/monero-javascript/issues/81
Wow. This is a crazy amount of code... it will be extremely useful for anyone using MoneroJs in the future. Great job. I was able to pull your PR into my active project by replacing monero-javascript
in the package.json file with "monero-javascript": "BeanTosser/monero-javascript#add_typescript_support"
(if anyone's interested)
It may be worth breaking things into additional index.d.ts files in each group (common, daemon, etc) just to make things a little less heavy in the big index file (though you would have to import the group indexes into the main index :upside_down_face: )
Bugs:
I'm not able to run this yet- first bug I'm seeing: Module not found: Error: Can't resolve './src/main/js/common/BigIntegerCompare' in 'node_modules/monero-javascript'
Replacing with #108