Version: Next

Class: SafeWallet

"wallets/SafeWallet".SafeWallet

Hierarchy#

  • SafeWallet

Implements#

Constructors#

constructor#

+ new SafeWallet(provider: TLProvider, safeRelayProvider: SafeRelayProvider, chainId: number, identityFactoryAddress: string, identityImplementationAddress: string, gnosisSafeL2Address: string, gnosisSafeProxyFactoryAddress: string, nonceMechanism: NonceMechanism): SafeWallet

Defined in src/wallets/SafeWallet.ts:52

Parameters:#

NameType
providerTLProvider
safeRelayProviderSafeRelayProvider
chainIdnumber
identityFactoryAddressstring
identityImplementationAddressstring
gnosisSafeL2Addressstring
gnosisSafeProxyFactoryAddressstring
nonceMechanismNonceMechanism

Returns: SafeWallet

Properties#

provider#

provider: TLProvider

Defined in src/wallets/SafeWallet.ts:41

Accessors#

address#

• get address(): string

Defined in src/wallets/SafeWallet.ts:75

Returns: string

Methods#

buildMetaTransaction#

buildMetaTransaction(rawTx: RawTxObject): SafeMetaTransaction

Defined in src/wallets/SafeWallet.ts:513

Parameters:#

NameType
rawTxRawTxObject

Returns: SafeMetaTransaction


confirm#

confirm(rawTx: RawTxObject): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:331

Takes a raw transaction object, turns it into a meta-transaction signed by the loaded user and relays the transaction.

Parameters:#

NameTypeDescription
rawTxRawTxObjectRaw transaction object.

Returns: Promise<string>

the hash of the meta-transaction


create#

create(): Promise<SafeWalletData>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:108

Creates wallet data of type identity.

Returns: Promise<SafeWalletData>


decrypt#

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

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:313

Parameters:#

NameType
encMsgany
theirPubKeystring

Returns: Promise<any>


deployIdentity#

deployIdentity(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:150

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/SafeWallet.ts:309

Parameters:#

NameType
msgstring
theirPubKeystring

Returns: Promise<any>


encryptToSerializedKeystore#

encryptToSerializedKeystore(walletData: SafeWalletData, password: string, progressCallback?: (progress: number) => any): Promise<string>

Defined in src/wallets/SafeWallet.ts:500

Returns a serialized encrypted ethereum JSON keystore v3.

Parameters:#

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

Returns: Promise<string>


exportPrivateKey#

exportPrivateKey(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:302

Returns a Promise with the private key of loaded user.

Returns: Promise<string>


getAddress#

getAddress(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:83

Returns: Promise<string>


getBalance#

getBalance(): Promise<Amount>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:98

Returns: Promise<Amount>


getIdentityImplementationAddress#

getIdentityImplementationAddress(): Promise<string>

Defined in src/wallets/SafeWallet.ts:215

Returns: Promise<string>


getMetaTxFees#

getMetaTxFees(rawTx: RawTxObject): Promise<SafeTransactionFees>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:479

Parameters:#

NameType
rawTxRawTxObject

Returns: Promise<SafeTransactionFees>


getNonce#

getNonce(): Promise<string>

Defined in src/wallets/SafeWallet.ts:531

Returns: Promise<string>


getTxStatus#

getTxStatus(metaTx: string | RawTxObject): Promise<TransactionStatusObject>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:486

Parameters:#

NameType
metaTxstring | RawTxObject

Returns: Promise<TransactionStatusObject>


getWalletData#

getWalletData(): Promise<SafeWalletData>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:90

Returns: Promise<SafeWalletData>


hashMetaTransaction#

hashMetaTransaction(metaTransaction: SafeMetaTransaction): Promise<string>

Defined in src/wallets/SafeWallet.ts:355

Parameters:#

NameType
metaTransactionSafeMetaTransaction

Returns: Promise<string>


hashTx#

hashTx(rawTx: RawTxObject): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:347

Return the meta-tx hash for given raw transaction for loaded user

Parameters:#

NameTypeDescription
rawTxRawTxObject

Returns: Promise<string>


isIdentityDeployed#

isIdentityDeployed(): Promise<boolean>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:184

Returns: Promise<boolean>


isIdentityImplementationUpToDate#

isIdentityImplementationUpToDate(): Promise<boolean>

Defined in src/wallets/SafeWallet.ts:208

Returns: Promise<boolean>


loadFrom#

loadFrom(walletData: SafeWalletData): Promise<void>

Defined in src/wallets/SafeWallet.ts:223

Loads given wallet data of type identity.

Parameters:#

NameTypeDescription
walletDataSafeWalletDataWallet data of type identity.

Returns: Promise<void>


prepareImplementationUpdate#

prepareImplementationUpdate(transaction: Transaction, options?: TxOptionsInternal): Promise<TxObjectInternal>

Defined in src/wallets/SafeWallet.ts:536

Parameters:#

NameTypeDefault value
transactionTransaction-
optionsTxOptionsInternal{}

Returns: Promise<TxObjectInternal>


prepareTransaction#

prepareTransaction(rawTx: RawTxObject): Promise<TxObjectRaw>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:445

Parameters:#

NameType
rawTxRawTxObject

Returns: Promise<TxObjectRaw>


recoverFromEncryptedKeystore#

recoverFromEncryptedKeystore(serializedEncryptedKeystore: string, password: string, progressCallback?: (progress: number) => any): Promise<SafeWalletData>

Defined in src/wallets/SafeWallet.ts:238

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 serialized encrypted ethereum JSON keystore v3 with.
progressCallback?(progress: number) => anyCallback function for decryption progress.

Returns: Promise<SafeWalletData>


recoverFromPrivateKey#

recoverFromPrivateKey(privateKey: string): Promise<SafeWalletData>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:277

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<SafeWalletData>


recoverFromSeed#

recoverFromSeed(seed: string): Promise<SafeWalletData>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:260

Recovers wallet data from mnemonic phrase.

Parameters:#

NameTypeDescription
seedstringMnemonic seed phrase.

Returns: Promise<SafeWalletData>


showSeed#

showSeed(): Promise<string>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:292

Returns a Promise with the mnemonic seed phrase of loaded user.

Returns: Promise<string>


signMessage#

signMessage(message: BytesLike): Promise<Signature>

Defined in src/wallets/SafeWallet.ts:321

Parameters:#

NameType
messageBytesLike

Returns: Promise<Signature>


signMetaTransaction#

signMetaTransaction(metaTransaction: SafeMetaTransaction): Promise<string>

Defined in src/wallets/SafeWallet.ts:435

Parameters:#

NameType
metaTransactionSafeMetaTransaction

Returns: Promise<string>


signMsgHash#

signMsgHash(msgHash: string): Promise<Signature>

Implementation of TLWallet

Defined in src/wallets/SafeWallet.ts:317

Parameters:#

NameType
msgHashstring

Returns: Promise<Signature>


waitForSafeToBeDeployed#

waitForSafeToBeDeployed(safeAddress: string): Promise<boolean>

Defined in src/wallets/SafeWallet.ts:119

Parameters:#

NameType
safeAddressstring

Returns: Promise<boolean>