-
Hey, our setup is an HSM signer (kp in this function) in a backend server. Off-chain signatures work fine with the safe transaction service, however we need on-chain signing to login to OpenSea, and other dApps that require it. async signMessage(
message: SafeMessage['message'],
kp: KeyPair,
safeAddress: string,
chainId: number = 5,
) {
const userSafe = this.getSafe(safeAddress, kp, chainId);
const resolvedUserSafe = await userSafe.safePromise;
const result = await userSafe.signData(message); // off-chain sig
const sig = await resolvedUserSafe
.getEthAdapter()
.getSignMessageLibContract({
safeVersion: await resolvedUserSafe.getContractVersion(),
chainId,
})
.signMessage(message as string); // on-chain sig
console.log(sig);
return result;
} However I seem to get:
And if I specify a custom contract address:
Any help on getting on-chain signing working is appreciated :), this is the last we're missing for a fully functional wallet. Tried going through this but they never show how to actually sign: https://gallery.mirror.xyz/GzHNX1UvpNmBDQjQ0pQnE_wsdxoS0_yWocRGOssH4Xw Same with this article: https://medium.com/mighty-bear-games/how-to-handle-gnosis-safe-connection-and-signature-e4b8e62cf14d When is the signMessage function from the lib called? and how? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
#529 I just saw this draft, does this mean it is not currently possible to do this properly? should we wait or make a build out of this branch? |
Beta Was this translation helpful? Give feedback.
-
Could you please explain why you need an onchain signature for opensea? It shouldn't matter to them which signature to use; they're just using EIP-1271 to validate the signature. Our interface works with opensea and off-chain signatures. |
Beta Was this translation helpful? Give feedback.
Update
Due to our custom setup, it seems we were missing to assign the contract FallbackHandler, and we had no way of verifying the signature properly due to that. I'll close because I doubt this would help others.