Created
February 9, 2024 20:31
-
-
Save dmulvi/05a276d934d169a8bb80da103aa5d50d to your computer and use it in GitHub Desktop.
Sign a message from a Crossmint wallet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
method: "POST", | |
headers: { "X-API-KEY": "YOUR_API_KEY", "Content-Type": "application/json" }, | |
body: JSON.stringify({ | |
message: "The message to be signed", | |
}), | |
}; | |
const baseUrl = "https://staging.crossmint.com/api"; | |
const chain = "polygon"; | |
const wallet = "0x_SIGNING_WALLET"; | |
fetch(`${baseUrl}/v1-alpha1/wallets/${chain}:${wallet}/signMessage`, options) | |
.then((response) => response.json()) | |
.then((response) => console.log(response)) | |
.catch((err) => console.error(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment