0
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);
})();

error : enter image description here

I am using it in backend(nodejs) but getting error.

how can i validate signature at backend?

1 Answer 1

0

The Safe apps sdk is meant for in-browser 3rd party apps connectivity. It has no use on the backend.

1
  • then for backend what i need to do? to verify the signature?
    – Nidorino k
    Commented Jul 13, 2023 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.