I am trying to follow the example from here, mostly to add transaction / sign off-chain: https://github.com/gnosis/safe-core-sdk/blob/main/packages/guides/integrating-the-safe-core-sdk.md
but i got the error: TypeError: Safe.create is not a function
import EthersAdapter from "@gnosis.pm/safe-ethers-lib";
import Safe, { SafeFactory } from "@gnosis.pm/safe-core-sdk";
import { ethers } from "ethers";
import abi from "./abi/abi.js";
const bulkMint = async () => {
const infuraProvider = new ethers.providers.InfuraProvider("rinkeby", {
projectId: "..",
projectSecret: "...",
});
const privateKey = "...";
const wallet = new ethers.Wallet(
`...`,
infuraProvider
);
const signer = await wallet.connect(infuraProvider);
const safeAddress = "...";
const contractAddress = "...";
let ethAdapterOwner1 = new EthersAdapter({ ethers, signer });
// error here
const safeSdk = await Safe.create({
ethAdapter: ethAdapterOwner1,
safeAddress: GNOSIS_SAFE_ADDR,
});
// rest of irrelevant code
};
I am using these: @gnosis.pm/safe-core-sdk: "^2.0.0", @gnosis.pm/safe-ethers-lib: "^1.0.0", @node 16.13
May I know if I am missing anything.
Here is the log for Safe object (console.log(Safe))
{
ContractManager: [class ContractManager],
SafeFactory: [class SafeFactory],
EthSignSignature: [class EthSignSignature],
standardizeSafeTransactionData: [Getter],
default: [class Safe]
}
console.log(Safe)
){ ContractManager: [class ContractManager], SafeFactory: [class SafeFactory], EthSignSignature: [class EthSignSignature], standardizeSafeTransactionData: [Getter], default: [class Safe] }
default
property