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

41 lines (36 loc) 1.85 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var ethers = require('ethers'); var evm_connectors_smartWallet_dist_thirdwebDevWalletsEvmConnectorsSmartWallet = require('../../smart-wallet/dist/thirdweb-dev-wallets-evm-connectors-smart-wallet.cjs.dev.js'); var utils = require('../../../../dist/utils-2aaa1386.cjs.dev.js'); require('../../../../dist/connector-a63dd9e7.cjs.dev.js'); require('eventemitter3'); require('../../../../dist/http-rpc-client-d27d3692.cjs.dev.js'); require('../../../../dist/url-4b641c31.cjs.dev.js'); require('@thirdweb-dev/chains'); require('../../../../dist/headers-2be346e5.cjs.dev.js'); require('@account-abstraction/contracts'); require('../../../../dist/defineProperty-9051a5d3.cjs.dev.js'); require('@thirdweb-dev/sdk'); require('../../../wallets/abstract/dist/thirdweb-dev-wallets-evm-wallets-abstract.cjs.dev.js'); class TokenBoundSmartWalletConnector extends evm_connectors_smartWallet_dist_thirdwebDevWalletsEvmConnectorsSmartWallet.SmartWalletConnector { constructor(input) { super({ ...input, factoryAddress: input.registryAddress || utils.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.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]); } }; } } exports.TokenBoundSmartWalletConnector = TokenBoundSmartWalletConnector;