I followed the docs of Protocol Kit. I want to connect to a Safe Wallet if it already exists or create a new one. My code : (assume things are defined above)
signer = provider.getSigner();
ethAdapterOwner1 = new EthersAdapter({
ethers,
signerOrProvider: signer
})
safeFactory = await SafeFactory.create({ ethAdapter: ethAdapterOwner1 })
const safeAccountConfig: SafeAccountConfig = {
owners:[
await signer.getAddress()
],
threshold:1
};
// if safe exists then get it's address and connect to it
let retrievedSafeAddress = localStorage.getItem("safeAddress");
if(retrievedSafeAddress){
const safeSdk = await Safe.create({ ethAdapterOwner1, retrievedSafeAddress })
return safeSdk;
}
const safeSdkOwner1 = await safeFactory.deploySafe({ safeAccountConfig })
const safeAddress = await safeSdkOwner1.getAddress()
I am getting the following error : "Argument of type '{ ethAdapterOwner1: EthersAdapter; retrievedSafeAddress: string; }' is not assignable to parameter of type 'SafeConfig'. Object literal may only specify known properties, and 'ethAdapterOwner1' does not exist in type 'SafeConfig'."