Skip to content

Error when run npm run authentication:login #155

@Fodesu

Description

@Fodesu

hey guys! i am beginger, i am trying to dev lens v2, when we try to run npm run authentication:login in cli, get errror:

forrest@fodesu ~/P/w/l/api-examples (master) [1]> npm run authentication:login

> lens-api-code-examples@1.0.0 authentication:login
> env-cmd -f .env ts-node ./src/authentication/login

/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/logger/src.ts/index.ts:269
        const error: any = new Error(message);
                           ^
Error: invalid private key (argument="privateKey", value="[[ REDACTED ]]", code=INVALID_ARGUMENT, version=signing-key/5.7.0)
    at Logger.makeError (/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at Logger.throwArgumentError (/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/logger/src.ts/index.ts:285:21)
    at new SigningKey (/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/signing-key/src.ts/index.ts:37:20)
    at new Wallet (/home/forrest/Project/web3/lens/api-examples/node_modules/@ethersproject/wallet/src.ts/index.ts:87:36)
    at getSigner (/home/forrest/Project/web3/lens/api-examples/src/ethers.service.ts:11:10)
    at getAddressFromSigner (/home/forrest/Project/web3/lens/api-examples/src/ethers.service.ts:15:19)
    at login (/home/forrest/Project/web3/lens/api-examples/src/authentication/login.ts:34:59)
    at /home/forrest/Project/web3/lens/api-examples/src/authentication/login.ts:58:16
    at Object.<anonymous> (/home/forrest/Project/web3/lens/api-examples/src/authentication/login.ts:60:3) {
  reason: 'invalid private key',
  code: 'INVALID_ARGUMENT',
  argument: 'privateKey',
  value: '[[ REDACTED ]]'
}

I log PK and ethersProvider

JsonRpcProvider {
  _isProvider: true,
  _events: [],
  _emitted: { block: -2 },
  disableCcipRead: false,
  formatter: Formatter {
    formats: {
      transaction: [Object],
      transactionRequest: [Object],
      receiptLog: [Object],
      receipt: [Object],
      block: [Object],
      blockWithTransactions: [Object],
      filter: [Object],
      filterLog: [Object]
    }
  },
  anyNetwork: false,
  _networkPromise: Promise { <pending> },
  _maxInternalBlockNumber: -1024,
  _lastBlockNumber: -2,
  _maxFilterBlockRange: 10,
  _pollingInterval: 4000,
  _fastQueryDate: 0,
  connection: {
    url: 'https://polygon-mumbai.infura.io/v3/********************************'
  },
  _nextId: 42
}

can anyone help me to fix it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions