import SafeAppsSDK from '@safe-global/safe-apps-sdk';
type Opts = {
allowedDomains?: RegExp[];
debug?: boolean;
};
const opts: Opts = {
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/],
debug: false,
};
const appsSdk = new SafeAppsSDK(opts);
(async () => {
const address = '0x5CB386304c1BE4dD5316FACDEE46869f7C1E2955';
const msg = `hi there (from hashmail)!\n\nTo ensure your ownership of this address, we need you to sign this message.\n\nThis request WILL NOT trigger a blockchain transaction or cost you any gas fees.\n\nWallet Address: ${address}`;
const sig =
'0x98cd5f5e9fc1e5047eec9c127ba03b938da9182859663c37ade00d712a604a814d22852af0857db5f47739a20aa4f64f826b8d64342d0a62df550f1dfc8c85061b6a0e20051cff6fe279f4992eb3186ad6276d2c59fe5bec1bfa7ec0cde04baa957518b03e0013f82733a01506f4f240c1ec37bbb28948f040b941a55390646db31b';
const messageIsSigned = await appsSdk.safe.isMessageSigned(msg, sig);
console.log(messageIsSigned);
})();
I am using it in backend(nodejs) but getting error.
how can i validate signature at backend?