-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Hi,
I've seen an increase in reports in the discord regarding issues with the generateKeyPair with newer releases of the sdk and NodeJS
I tried going back thru previous releases:
3.8.0 & prior give me ERR_REQUIRE_ESM errors.
3.4.0 works but still hangs.
here is the error for the most recent release (3.8.13):
personalSign -> counterFactualInfo undefined keySeed Sign this message to access Loopring Exchange: 0x12b7cccF30ba360e5041C6Ce239C9a188B709b2B with key nonce: 0 walletType Unknown publicKey from sever side undefined
IsMobile any navigator is undefined
ecRecover before msg Sign this message to access Loopring Exchange: 0x12b7cccF30ba360e5041C6Ce239C9a188B709b2B with key nonce: 0 result 0x85bcef87ba0f75ed55ce80e91557baedc3ec04d42341c5c234f18bab993207217545b8f068598f1927d4bdbdb6dfed3f90d4b602d05d01ba6a014e667a9a12ab1c undefined
Valid: 3. contractWallet before
web3.eth.personal.sign Valid, valid 5 ways, all failed!
generateKeyPair personalSign error web3.eth.personal.sign Valid, valid 5 ways, all failed!
Error: Error: web3.eth.personal.sign Valid, valid 5 ways, all failed!
at Object.gr [as generateKeyPair] (/Users/willsmillie/Downloads/test_project/node_modules/@loopring-web/loopring-sdk/dist/index.cjs:1:62250)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async signatureKeyPairMock (/Users/willsmillie/Downloads/test_project/test.js:32:20)
at async authenticate (/Users/willsmillie/Downloads/test_project/test.js:64:22)
my implementation:
const signatureKeyPairMock = async (accInfo, exchangeAddress) => {
// initialize provider
const provider = new PrivateKeyProvider(
ETH_ACCOUNT_PRIVATE_KEY,
`https://goerli.infura.io/v3/${INFURA_PROJECT_ID}`
);
const web3 = new Web3(provider);
const keySeed =
accInfo.keySeed ||
sdk.GlobalAPI.KEY_MESSAGE.replace(
"${exchangeAddress}",
exchangeAddress
).replace("${nonce}", (accInfo.nonce - 1).toString());
const eddsaKey = await sdk.generateKeyPair({
web3,
address: accInfo.owner,
keySeed,
walletType: sdk.ConnectorNames.Unknown,
chainId: parseInt(CHAIN_ID, 10),
});
return eddsaKey;
};
Metadata
Metadata
Assignees
Labels
No labels