File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Command } from 'commander' ;
22import { Commands } from './commands.js' ;
3- import { JsonRpcProvider , Wallet , ethers } from 'ethers' ;
3+ import { JsonRpcProvider , Signer , ethers } from 'ethers' ;
44import chalk from 'chalk' ;
55import { stdin as input , stdout as output } from 'node:process' ;
66import { createInterface } from 'readline/promises' ;
@@ -10,17 +10,16 @@ import { toBoolean } from './helpers.js';
1010async function initializeSigner ( ) {
1111
1212 const provider = new JsonRpcProvider ( process . env . RPC ) ;
13- let signer ;
13+ let signer : Signer ;
1414
1515 if ( process . env . PRIVATE_KEY ) {
1616 signer = new ethers . Wallet ( process . env . PRIVATE_KEY , provider ) ;
1717 } else {
18- signer = Wallet . fromPhrase ( process . env . MNEMONIC ) ;
19- signer = await signer . connect ( provider ) ;
18+ signer = ethers . Wallet . fromPhrase ( process . env . MNEMONIC , provider ) ;
2019 }
2120
2221 const { chainId } = await signer . provider . getNetwork ( ) ;
23- return { signer, chainId } ;
22+ return { signer, chainId : Number ( chainId ) } ;
2423}
2524
2625export async function createCLI ( ) {
You can’t perform that action at this time.
0 commit comments