Version: 0.15.0

Class: EthersWallet

"wallets/EthersWallet".EthersWallet

The EthersWallet class contains wallet related methods.

Hierarchy#

  • EthersWallet

Implements#

Constructors#

constructor#

+ new EthersWallet(provider: TLProvider): EthersWallet

Defined in src/wallets/EthersWallet.ts:31

Parameters:#

NameType
providerTLProvider

Returns: EthersWallet

Properties#

provider#

• provider: TLProvider

Defined in src/wallets/EthersWallet.ts:29

Accessors#

address#

• get address(): string

Defined in src/wallets/EthersWallet.ts:42

Returns: string

Methods#

confirm#

â–¸ confirm(rawTx: RawTxObject): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:197

Takes a raw transaction object, turns it into a RLP encoded hex string, signs it with the loaded user and relays the transaction.

Parameters:#

NameTypeDescription
rawTxRawTxObjectRaw transaction object.

Returns: Promise<string>


create#

â–¸ create(): Promise<EthersWalletData>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:70

Creates wallet data of type ethers.

Returns: Promise<EthersWalletData>


decrypt#

â–¸ decrypt(encMsg: any, theirPubKey: string): Promise<any>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:288

Parameters:#

NameType
encMsgany
theirPubKeystring

Returns: Promise<any>


deployIdentity#

â–¸ deployIdentity(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:78

Deploys a new identity contract on the chain

Returns: Promise<string>


encrypt#

â–¸ encrypt(msg: string, theirPubKey: string): Promise<any>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:284

Parameters:#

NameType
msgstring
theirPubKeystring

Returns: Promise<any>


encryptToSerializedKeystore#

â–¸ encryptToSerializedKeystore(walletData: EthersWalletData, password: string, progressCallback?: (progress: number) => any): Promise<string>

Defined in src/wallets/EthersWallet.ts:94

Encrypts and serializes the given wallet data.

Parameters:#

NameTypeDescription
walletDataEthersWalletDataWallet data of type ethers.
passwordstringPassword to encrypt wallet data with.
progressCallback?(progress: number) => anyOptional encryption progress callback.

Returns: Promise<string>

Serialized encrypted ethereum JSON keystore v3.


exportPrivateKey#

â–¸ exportPrivateKey(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:273

Returns a Promise with the private key of loaded user.

Returns: Promise<string>


getAddress#

â–¸ getAddress(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:49

Returns: Promise<string>


getBalance#

â–¸ getBalance(): Promise<Amount>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:251

Returns a Promise with the balance of loaded user.

Returns: Promise<Amount>


getMetaTxFees#

â–¸ getMetaTxFees(rawTx: RawTxObject): Promise<MetaTransactionFees>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:320

Parameters:#

NameType
rawTxRawTxObject

Returns: Promise<MetaTransactionFees>


getTxStatus#

â–¸ getTxStatus(tx: string | RawTxObject): Promise<TransactionStatusObject>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:313

Parameters:#

NameType
txstring | RawTxObject

Returns: Promise<TransactionStatusObject>


getWalletData#

â–¸ getWalletData(): Promise<EthersWalletData>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:56

Returns: Promise<EthersWalletData>


hashTx#

â–¸ hashTx(rawTx: RawTxObject): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:237

Returns the hash of the signed transaction for given rawTx with loaded user

Parameters:#

NameTypeDescription
rawTxRawTxObject

Returns: Promise<string>


isIdentityDeployed#

â–¸ isIdentityDeployed(): Promise<boolean>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:83

Returns: Promise<boolean>


loadFrom#

â–¸ loadFrom(walletData: EthersWalletData): Promise<void>

Defined in src/wallets/EthersWallet.ts:111

Loads given wallet data of type ethers.

Parameters:#

NameTypeDescription
walletDataEthersWalletDataWallet data of type ethers.

Returns: Promise<void>


prepareTransaction#

â–¸ prepareTransaction(rawTx: RawTxObject): Promise<TxObjectRaw>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:292

Parameters:#

NameType
rawTxRawTxObject

Returns: Promise<TxObjectRaw>


recoverFromEncryptedKeystore#

â–¸ recoverFromEncryptedKeystore(serializedEncryptedKeystore: string, password: string, progressCallback?: (progress: number) => any): Promise<EthersWalletData>

Defined in src/wallets/EthersWallet.ts:123

Recovers wallet data from a serialized encrypted ethereum JSON keystore v3 (e.g. as returned by encryptToSerializedKeystore).

Parameters:#

NameTypeDescription
serializedEncryptedKeystorestringSerialized encrypted ethereum JSON keystore v3.
passwordstringPassword to decrypt encrypted ethereum JSON keystore v3.
progressCallback?(progress: number) => anyCallback function for decryption progress.

Returns: Promise<EthersWalletData>


recoverFromPrivateKey#

â–¸ recoverFromPrivateKey(privateKey: string): Promise<EthersWalletData>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:150

Recovers wallet data from private key. Note that mnemonic and derivation path is undefined here.

Parameters:#

NameTypeDescription
privateKeystringPrivate key to recover wallet data from.

Returns: Promise<EthersWalletData>


recoverFromSeed#

â–¸ recoverFromSeed(seed: string): Promise<EthersWalletData>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:140

Recovers wallet data from mnemonic phrase.

Parameters:#

NameTypeDescription
seedstringMnemonic seed phrase.

Returns: Promise<EthersWalletData>


showSeed#

â–¸ showSeed(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:263

Returns a Promise with the mnemonic seed phrase of loaded user. Note that the returned seed is undefined for accounts recovered by a private key or serialized encrypted keystores that were not created with ethers.

Returns: Promise<string>


signMessage#

â–¸ signMessage(message: ethersUtils.Arrayish): Promise<Signature>

Defined in src/wallets/EthersWallet.ts:180

Signs given message with loaded wallet.

Parameters:#

NameTypeDescription
messageethersUtils.ArrayishMessage to sign.

Returns: Promise<Signature>


signMsgHash#

â–¸ signMsgHash(msgHash: string): Promise<Signature>

Implementation of TLWallet

Defined in src/wallets/EthersWallet.ts:165

Signs given hex hash of message with loaded wallet.

Parameters:#

NameTypeDescription
msgHashstringHash of message to sign.

Returns: Promise<Signature>


signTx#

â–¸ signTx(rawTx: RawTxObject): Promise<string>

Defined in src/wallets/EthersWallet.ts:209

Takes a raw transaction object and signs it RLP encoded with the loaded user

Parameters:#

NameTypeDescription
rawTxRawTxObject

Returns: Promise<string>