Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ethers-repl
Advanced tools
Opens ethers.js in Node.js repl with Ethers.js and some providers / contracts preloaded in global.
Readme
Opens ethers.js in Node.js repl with Ethers.js and some providers / contracts preloaded in global.
npm i -g ethers ethers-repl
Use the command ethers
or ethers-repl
in your terminal. This should open a REPL.
$ ethers
ethers-repl>
ethers
here along with usual nodejs repl things.ethers-repl> ethers.version
'6.3.0'
ethers-repl> ethers.getAddress('c21f0a4a6eb27762a218acbb05922fa5703dcf3f')
'0xC21F0a4a6EB27762A218aCbB05922fa5703dCF3f'
ethers-repl> getAddress('c21f0a4a6eb27762a218acbb05922fa5703dcf3f')
'0xC21F0a4a6EB27762A218aCbB05922fa5703dCF3f'
ethers-repl> FixedNumber.fromValue(1, 18)
FixedNumber { format: undefined, value: "0.000000000000000001" }
dai
and weth
contractsethers-repl> await dai.balanceOf("vitalik.eth")
555508493698012633714742n
$ ethers dai balanceOf "vitalik.eth"
27183125886000881460504n
ethers-repl> wallet = vanity(startsWith('dad'), 10000)
Wallet {
_isSigner: true,
address: '0xdAd5589FA9A17f13B69a3A3a2Fff24190e22f18c',
provider: null
}
// you can list wallets which are stored at keystores.path(), can be set with env var: ETHERS_REPL_KEYSTORES_PATH
ethers-repl> keystores.list()
[
{
address: '0xff2b2f4d55cc37661dbd88d92b1fff8b29cda06c',
jsonFile: '/Users/sohamzemse/ethers-repl-wallets/0xFf2B2f4d55cC37661DbD88d92b1FFf8b29CDa06C.json'
}
]
// just pass some part of address, password and provider object
ethers-repl> wallet = keystores.load('0xff', 'mypassword', mainnet)
Unlocking 0xFf2B2f4d55cC37661DbD88d92b1FFf8b29CDa06C
Wallet {
_isSigner: true,
_signingKey: [Function (anonymous)],
address: '0xFf2B2f4d55cC37661DbD88d92b1FFf8b29CDa06C',
_mnemonic: [Function (anonymous)],
provider: null
}
// it returns an ethers.Wallet which you can use as usual
ethers-repl> await wallet.getBalance()
BigNumber { value: "0", hex: "0x00" }
Learn more about SQRL-ing from an article by ricmoo.
ethers-repl> wallet = await sqrlMnemonic('some mnemonic here' , "some password")
Wallet {
provider: null,
address: '0x9F432F2D6b24A95aDAf9242f79B573fd93F9804D'
}
FAQs
Opens ethers.js in Node.js repl with Ethers.js and some providers / contracts preloaded in global.
The npm package ethers-repl receives a total of 9 weekly downloads. As such, ethers-repl popularity was classified as not popular.
We found that ethers-repl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.