UNPKG

@thirdweb-dev/wallets

Version:

<p align="center"> <br /> <a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> <br /> </p> <h1 align="center">thirdweb Wallet SDK</h1> <p align="center"> <a h

43 lines (39 loc) 1.04 kB
import { AbstractWallet } from '../../abstract/dist/thirdweb-dev-wallets-evm-wallets-abstract.browser.esm.js'; import '../../../../dist/defineProperty-350fc508.browser.esm.js'; import 'ethers'; import 'eventemitter3'; import '@thirdweb-dev/sdk'; /** * Wallet interface to connect using [ethers.js](https://github.com/ethers-io/ethers.js/) signer * * @example * ```javascript * import { EthersWallet } from "@thirdweb-dev/wallets"; * import { Wallet } from "ethers"; * * // can be any ethers.js signer * const signer = Wallet.createRandom(); * const wallet = new EthersWallet(signer); * * await wallet.connect(); * ``` * * @wallet */ class EthersWallet extends AbstractWallet { /** * Create instance of `EthersWallet` * @param signer - ethers.js signer object */ constructor(signer) { super(); this._signer = signer; } /** * Returns [ethers signer](https://docs.ethers.org/v5/api/signer/) object used by the wallet */ async getSigner() { return this._signer; } } export { EthersWallet };