starkware-libs / starkware-crypto-utils

Signatures, keys and Pedersen hash on STARK friendly elliptic curve
Apache License 2.0
54 stars 37 forks source link

Importing `@starkware-industries/starkware-crypto-utils` returns an empty object #19

Closed luccamordente closed 7 months ago

luccamordente commented 8 months ago

Describe the bug I'm upgrading from 0.0.2 to 0.2.0. Importing from '@starkware-industries/starkware-crypto-utils' returns an empty object.

To Reproduce

const starkwareCrypto = require("@starkware-industries/starkware-crypto-utils");

console.log({ "starkwareCrypto": starkwareCrypto }); 
// => { starkwareCrypto: {} }

console.log({ "starkwareCypto.keyDerivation": starkwareCrypto.keyDerivation }); 
// => { 'starkwareCypto.keyDerivation': undefined }

Here's a CodeSandbox

Expected behavior I should be able to do this without an error:

const starkwareCrypto = require("@starkware-industries/starkware-crypto-utils");

const ethSignature =
  "0x21fbf0696d5e0aa2ef41a2b4ffb623bcaf070461d61cf7251c74161f82fec3a43" +
  "70854bc0a34b3ab487c1bc021cd318c734c51ae29374f2beb0e6f2dd49b4bf41c";

starkwareCrypto.keyDerivation.getPrivateKeyFromEthSignature(ethSignature);
// TypeError: Cannot read properties of undefined (reading 'getPrivateKeyFromEthSignature')
RedaOps commented 8 months ago

Might be because of https://github.com/starkware-libs/starkware-crypto-utils/commit/01e5c58b09b46bac6c4b832b4a8a8601f6075db0 since it only exports as an ESM module

@dan-ziv

luccamordente commented 8 months ago

Doesn't work with ESM import either: CodeSandbox

dan-ziv commented 7 months ago

:tada: This issue has been resolved in version 0.2.1-dev.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

dan-ziv commented 7 months ago

:tada: This issue has been resolved in version 0.2.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: