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:Name | Type |
---|---|
provider | TLProvider |
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:Name | Type | Description |
---|---|---|
rawTx | RawTxObject | Raw 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:Name | Type |
---|---|
encMsg | any |
theirPubKey | string |
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:Name | Type |
---|---|
msg | string |
theirPubKey | string |
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:Name | Type | Description |
---|---|---|
walletData | EthersWalletData | Wallet data of type ethers . |
password | string | Password to encrypt wallet data with. |
progressCallback? | (progress: number) => any | Optional 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:Name | Type |
---|---|
rawTx | RawTxObject |
Returns: Promise<MetaTransactionFees>
#
getTxStatusâ–¸ getTxStatus(tx
: string | RawTxObject): Promise<TransactionStatusObject>
Implementation of TLWallet
Defined in src/wallets/EthersWallet.ts:313
#
Parameters:Name | Type |
---|---|
tx | string | 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:Name | Type | Description |
---|---|---|
rawTx | RawTxObject |
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:Name | Type | Description |
---|---|---|
walletData | EthersWalletData | Wallet data of type ethers . |
Returns: Promise<void>
#
prepareTransactionâ–¸ prepareTransaction(rawTx
: RawTxObject): Promise<TxObjectRaw>
Implementation of TLWallet
Defined in src/wallets/EthersWallet.ts:292
#
Parameters:Name | Type |
---|---|
rawTx | RawTxObject |
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:Name | Type | Description |
---|---|---|
serializedEncryptedKeystore | string | Serialized encrypted ethereum JSON keystore v3. |
password | string | Password to decrypt encrypted ethereum JSON keystore v3. |
progressCallback? | (progress: number) => any | Callback 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:Name | Type | Description |
---|---|---|
privateKey | string | Private 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:Name | Type | Description |
---|---|---|
seed | string | Mnemonic 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
: BytesLike): Promise<Signature>
Defined in src/wallets/EthersWallet.ts:180
Signs given message with loaded wallet.
#
Parameters:Name | Type | Description |
---|---|---|
message | BytesLike | Message 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:Name | Type | Description |
---|---|---|
msgHash | string | Hash 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:Name | Type | Description |
---|---|---|
rawTx | RawTxObject |
Returns: Promise<string>