Remove the EthersAdapter and Web3Adapter, and add the SafeProvider with standard EIP-1193 support and additional Safe-specific functionality. The SafeProvider is instantiated internally, so there is no need to add it as an input parameter as with the adapters.
signer is optional so if not specified will try to get the first connected one in the provider (eth_accounts, eth_requestAccounts)
// before
await Safe.create({
ethAdapter: new EthersAdapter({ ethers, signerOrProvider })
safeAddress: '0xSafeAddress'
...
})
// now
await Safe.init({
provider: window.ethereum, // Or any compatible EIP-1193 provider
signer: 'signerAddressOrPrivateKey'
safeAddress: '0xSafeAddress'
...
})
// ...or...
await Safe.init({
provider: 'http://rpc.url', //Or websocket
signer: 'signerAddressOrPrivateKey'
safeAddress: '0xSafeAddress'
...
})
This change make the AccountAbstraction and Safe4337Pack instantiation different as well as the dependency with the EthAdapter is changed to provider + signer (Same as Safe.create)
e2e tests
Remove ganache tests
Add viem support tests in e2e action and scripts (same as ethers and web3)
Refactor api-kit tests
Refactor protocol-kit tests
Remove all Web3 specific dependencies (web3-utils, web3-core) and contracts
Remove gas from TransactionOptions and specific return types from web3
Simplify types as the Safe*ImplementationType's and DeepWriteable's
Remove all Ethers suffixes as now are the unique contract types and files
What it solves
Resolves https://github.com/safe-global/safe-core-sdk/issues/651
How this PR fixes it
EthersAdapter
andWeb3Adapter
, and add theSafeProvider
with standard EIP-1193 support and additional Safe-specific functionality. TheSafeProvider
is instantiated internally, so there is no need to add it as an input parameter as with the adapters.signer
is optional so if not specified will try to get the first connected one in the provider (eth_accounts
,eth_requestAccounts
)This change make the
AccountAbstraction
andSafe4337Pack
instantiation different as well as the dependency with theEthAdapter
is changed to provider + signer (Same as Safe.create)viem
support tests in e2e action and scripts (same asethers
andweb3
)api-kit
testsprotocol-kit
testsgas
fromTransactionOptions
and specific return types from web3Safe*ImplementationType
's andDeepWriteable
'sEthers
suffixes as now are the unique contract types and files