starknet.js icon indicating copy to clipboard operation
starknet.js copied to clipboard

The demo of the EthSigner is incomplete

Open wuyingfengsui opened this issue 1 year ago • 1 comments

I found the EthSigner in the document. I think it can be used when I already have an ETH account. But I can't find how to generate a starknet address from eth private key.

wuyingfengsui avatar Mar 07 '24 07:03 wuyingfengsui

Hello, You are right. That's why the PR https://github.com/starknet-io/starknet.js/pull/985 has been proposed, to have a full compatibility with the new OpenZeppelin Ethereum account. This PR is waiting a review from the team, but it's not priority one. Once merged, you will be able to have the account address this way : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/da4431bf8b250d2503b008d0a7a997cda5923e95/src/scripts/15.createNewETHaccount.ts#L62

PhilippeR26 avatar Mar 07 '24 09:03 PhilippeR26

LGTM. I will have a try after the PR merged.

wuyingfengsui avatar Mar 08 '24 07:03 wuyingfengsui

Hi. I tried the latest version and got the error when fee estimation:

LibraryError: RPC: starknet_estimateFee with params {
  "request": [
    {
      "type": "DEPLOY_ACCOUNT",
      "constructor_calldata": [
        "0xd47b7759e077b975dcbbb6c6da00f6b6",
        "0x35f60f81ee60f5f69fca84442f9940",
        "0xce797c8b923014f804848f83044de27c",
        "0x294a885a7448657f1f1d7f6c3357db03"
      ],
      "class_hash": "0x23e416842ca96b1f7067693892ed00881d97a4b0d9a4c793b75cb887944d98d",
      "contract_address_salt": "0xd47b7759e077b975dcbbb6c6da00f6b6",
      "version": "0x100000000000000000000000000000001",
      "signature": [],
      "nonce": "0x0",
      "max_fee": "0x0"
    }
  ],
  "block_id": "pending",
  "simulation_flags": [
    "SKIP_VALIDATE"
  ]
}

        41: Transaction execution error: {"execution_error":"Contract constructor execution has failed: Execution failed. Failure reason: 0x4661696c656420746f20646573657269616c697a6520706172616d202331 ('Failed to deserialize param #1').","transaction_index":0}

wuyingfengsui avatar Mar 26 '24 09:03 wuyingfengsui

Do you mean the code in my tuto?

PhilippeR26 avatar Mar 26 '24 10:03 PhilippeR26

Yeah. This line: https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/da4431bf8b250d2503b008d0a7a997cda5923e95/src/scripts/15.createNewETHaccount.ts#L80

wuyingfengsui avatar Mar 27 '24 02:03 wuyingfengsui

This commit is rather old. Please checkout latest commit and re-test.

PhilippeR26 avatar Mar 27 '24 08:03 PhilippeR26

It works. Thanks.

wuyingfengsui avatar Mar 27 '24 09:03 wuyingfengsui