vue-dapp
vue-dapp copied to clipboard
Add Gnosis Safe
sdk: https://docs.gnosis-safe.io/build/sdks/safe-apps/build
Any update on this one ?
@re2005 No, sorry. My hands are full recently. Do you want to make it work?
Already trying to fix this.
https://github.com/safe-global/safe-apps-sdk/issues/337
Hi @re2005 Any update on the integration of gnosis ? If not I might give it a try soon Thanks
@fran6brg in order to use Gnosis Safe you should do something like this:
You will need to install @gnosis.pm/safe-apps-wagmi
import { MetaMaskConnector, WalletConnectConnector } from 'vue-dapp';
import { SafeConnector } from '@gnosis.pm/safe-apps-wagmi';
const isServer = typeof window === 'undefined';
const isIframe = !isServer && window?.parent !== window;
const connectors: any = [
new MetaMaskConnector({
appUrl: window.location.href,
}),
new WalletConnectConnector({
qrcode: true,
rpc: {},
}),
];
if (isIframe) {
connectors.push(new SafeConnector({}));
}
export const isGnosisSafeApp = isIframe;
export default connectors;
So basically within your connect you can check if your dapp is running inside GnosisSafe and than just use
new SafeConnector({})
Give it a try ;)
Just tested your suggestion of code, for me it works perfectly 🙏 I only had some minor typescript issues but surely because I modified the vue-dapp package a bit
@fran6brg please feel free to suggest improvements for this repo as well.
Cheers.
You will need to install
@gnosis.pm/safe-apps-wagmiimport { MetaMaskConnector, WalletConnectConnector } from 'vue-dapp'; import { SafeConnector } from '@gnosis.pm/safe-apps-wagmi'; const isServer = typeof window === 'undefined'; const isIframe = !isServer && window?.parent !== window; const connectors: any = [ new MetaMaskConnector({ appUrl: window.location.href, }), new WalletConnectConnector({ qrcode: true, rpc: {}, }), ]; if (isIframe) { connectors.push(new SafeConnector({})); } export const isGnosisSafeApp = isIframe; export default connectors;So basically within your connect you can check if your dapp is running inside GnosisSafe and than just use
new SafeConnector({})Give it a try ;)
Seems that this solution can be written down on the document and then it's better to close this issue