Skip to content

Commit

Permalink
Update ethersv6 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dasanra committed Nov 28, 2023
1 parent efd4e47 commit 9215618
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions safe-core-sdk/auth-kit/guides/safe-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ import { ethers } from 'ethers'
import { EthersAdapter } from '@safe-global/protocol-kit'

// Wrap EIP-1193 provider with ethers
const provider = new ethers.providers.Web3Provider(safeAuthPack.getProvider())
const provider = new ethers.BrowserProvider(safeAuthPack.getProvider())
const signer = provider.getSigner()

// Create the Safe EthersAdapter
Expand All @@ -135,11 +135,11 @@ const protocolKit = await Safe.create({
const safeTransactionData: MetaTransactionData = {
to: `${ethAddress}`,
data: '0x',
value: ethers.utils.parseUnits('0.0001', 'ether').toString(),
value: ethers.parseUnits('0.0001', 'ether').toString(),
}

const safeTransaction = await protocolKit.createTransaction({
safeTransactionData,
transactions: [safeTransactionData],
})

// Sign the transaction if the Safe have several owners
Expand All @@ -165,7 +165,7 @@ const address = '0x...'
await web3.eth.personal.sign(message, address)

// Using ethers
const provider = new ethers.providers.Web3Provider(safeAuthPack.getProvider())
const provider = new ethers.BrowserProvider(safeAuthPack.getProvider())
const signer = provider.getSigner()

await signer.sendTransaction(tx)
Expand Down

0 comments on commit 9215618

Please sign in to comment.