ethers.js-2-wallets and signers

Application Programming Interface (API)

Wallets and Signers

A Wallet manages a private/public key pair which is used to cryptographically sign transactions and prove ownership on the Ethereum network.钱包管理一个私有/公钥对,该对用于在Ethereum网络上对交易进行加密签名并证明所有权。

Wallet

The Wallet implements the Signer API and can be used anywhere a Signer is expected and has all the required properties.钱包实现了签名者API,可以在需要签名者的任何地方使用,并具有所有必需的属性。

Creating Instances

new  Wallet ( privateKey [ , provider ] )
Creates a new instance from  privateKey and optionally connect a provider
使用私钥创建新实例并可选地连接provider
Wallet. createRandom ( [ options ] )   => Wallet

Creates a new random wallet. Ensure this wallet is stored somewhere safe, if lost there is NO way to recover it.

随机创建钱包。保证钱包存储在某个安全的地方,如果丢失了是没有办法恢复的

Options may have the properties:可选项的属性

  • extraEntropy — additional entropy to stir into the random source额外的熵加入到随机源中
Wallet. fromEncryptedJson ( json, password [ , progressCallback ] )   => Wallet (回调)
Decrypt an encrypted Secret Storage JSON Wallet (from Geth, parity, Crowdsale tools, or that was created using  prototype.encrypt )
对加密的秘密存储JSON钱包进行解密
Wallet. fromMnemonic ( mnemonic [ , path = “m/44’/60’/0’/0/0” [ , wordlist ] ] )   => Wallet

Generate a BIP-039 + BIP-044 wallet from mnemonic deriving path using the wordlist. The default language is English (en).

通过使用wordlist并从path派生的助记词来创建 BIP-039 + BIP-044钱包。默认的语言是英语

In the browserified dist/ethers.min.js only the English wordlist is available. Each additional wordlist may be included by adding a 

你可能感兴趣的:(ethers.js-2-wallets and signers)