How to send transaction using Safe Wallet with wagmi connector?

How to send transaction using Safe Wallet with wagmi connector?

Manage alerts

Loading saved threads...

Alex Kraiz · External communityPost link
External question — Ethereum Stack Exchange Author: Alex Kraiz Original post: https://ethereum.stackexchange.com/questions/163703 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I am trying to develop a Safe Global dApp using viem and wagmi's Safe connector ( https://wagmi.sh/react/api/connectors/safe ). When I tried to send a transaction (call some contract), it throws an error saying "unknown account". I checked the transaction data and noticed that the from address is the Safe contract address. This might be the reason for the error, but not sure how can I fix this. My config: import { mainnet, sepolia } from "viem/chains"; import { safe } from "wagmi/connectors"; const connector = safe({ allowedDomains: [/app.safe.global$/], }); const config = createConfig({ chains, connectors: [connector], transports: { [mainnet.id]: http(), [sepolia.id]: http(), }, }); Can't find any examples of sending transaction (write to contract in my case) through Safe's Wagmi connector even in official examples ( https://github.com/safe-global/safe-apps-sdk/tree/main/examples/wagmi )
Quote
Report
Louis Margot-Duclot · External communityPost link
External answer — Ethereum Stack Exchange Author: Louis Margot-Duclot Original post: https://ethereum.stackexchange.com/a/163789 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. There is an example of a dummy contract write in the example app here . You can look at wagmi doc to know how to populate this example with the correct parameters ( address , abi , and functionName ). Hope it helps; Best, Louis
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Ethereum Stack Exchange Author: Alex Kraiz Source score (net votes, not local likes): 0 Original post: https://ethereum.stackexchange.com/questions/163703 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I am trying to develop a Safe Global dApp using viem and wagmi's Safe connector ( https://wagmi.sh/react/api/connectors/safe ). When I tried to send a transaction (call some contract), it throws an error saying "unknown account". I checked the transaction data and noticed that the from address is the Safe contract address. This might be the reason for the error, but not sure how can I fix this. My config: import { mainnet, sepolia } from "viem/chains"; import { safe } from "wagmi/connectors"; const connector = safe({ allowedDomains: [/app.safe.global$/], }); const config = createConfig({ chains, connectors: [connector], transports: { [mainnet.id]: http(), [sepolia.id]: http(), }, }); Can't find any examples of sending transaction (write to contract in my case) through Safe's Wagmi connector even in official examples ( https://github.com/safe-global/safe-apps-sdk/tree/main/examples/wagmi )

Cancel quote

Checking account access…