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

37 lines (34 loc) 1.63 kB
import { ethers } from 'ethers'; import { SmartWalletConnector } from '../../smart-wallet/dist/thirdweb-dev-wallets-evm-connectors-smart-wallet.browser.esm.js'; import { E as ERC6551_REGISTRY } from '../../../../dist/utils-f58e7acc.browser.esm.js'; import '../../../../dist/connector-05689d68.browser.esm.js'; import 'eventemitter3'; import '../../../../dist/http-rpc-client-0a079e80.browser.esm.js'; import '../../../../dist/url-a45219bd.browser.esm.js'; import '@thirdweb-dev/chains'; import '../../../../dist/headers-733a8199.browser.esm.js'; import '@account-abstraction/contracts'; import '../../../../dist/defineProperty-350fc508.browser.esm.js'; import '@thirdweb-dev/sdk'; import '../../../wallets/abstract/dist/thirdweb-dev-wallets-evm-wallets-abstract.browser.esm.js'; class TokenBoundSmartWalletConnector extends SmartWalletConnector { constructor(input) { super({ ...input, factoryAddress: input.registryAddress || ERC6551_REGISTRY }); this.tbaConfig = input; // TODO default account implementation address } defaultFactoryInfo() { return { createAccount: async factory => { return factory.prepare("createAccount", [this.tbaConfig.accountImplementation, this.chainId, this.tbaConfig.tokenContract, this.tbaConfig.tokenId, this.tbaConfig.salt, ethers.utils.toUtf8Bytes("")]); }, getAccountAddress: async factory => { return await factory.call("account", [this.tbaConfig.accountImplementation, this.chainId, this.tbaConfig.tokenContract, this.tbaConfig.tokenId, this.tbaConfig.salt]); } }; } } export { TokenBoundSmartWalletConnector };