0

I'm trying to use safe-core-sdk on our Dapp but the EthersAdapter instance creation is always giving empty object even the signer is getting from the provider is working fine enter image description here

Lib used : ether.js ^5.5.2 , "bnc-onboard": "^1.35.4",

Attaching console screenshot and code below

  const safeService = new SafeServiceClient(transactionServiceUrl);
        const onboard = initOnboard({
            address: setAddress,
            network: setNetwork,
            balance: setBalance,
            wallet: wallet => {
                setWallet(wallet);

                if (wallet.provider) {
                    console.info(`${wallet.name} is connected`);

                    const ethersProvider = new Web3Provider(wallet.provider);
                    console.log(ethersProvider.getSigner());
                    // signerAddress(ethersProvider.getSigner());
                    const ethersAdapter = new EthersAdapter({
                        ethers: ethers,
                        signer: ethersProvider.getSigner(0),
                    });
                    console.log(ethersAdapter);
                    setEthersAdaptor(ethersAdapter);
                    // provider = ethersProvider;
                    setProvider(ethersProvider);

                    window.localStorage.setItem("selectedWallet", wallet.name);
                } else {
                    // provider = null;

                    setProvider(false);
                    setWallet({});
                }
            },
        });

1 Answer 1

2

Can you see the methods inside EthersAdapter class if you expand it?

enter image description here

1
  • Yea receiving it , Thanks for the response ! Jan 10, 2022 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.