Authentication
All endpoints require the following headers unless otherwise noted:Sign Data
Sign data with the authenticated user’s Magic wallet.cURL
transaction_data instead of message:
cURL
Request Parameters
Provide eithermessage or transaction_data.
A plain text message to sign. It is signed as an EIP-191 (
personal_sign) message over its UTF-8 bytes, so you can verify it with standard tools such as ethers’ verifyMessage.What to sign, in one of two forms:
- EIP-712 typed data:
{"method": "eth_signTypedData_v4", "typedData": {...}}.typedDatahastypes(includingEIP712Domain),primaryType,domainandmessage, as passed toeth_signTypedData_v4. The signature is over the typed data’s EIP-712 digest, so it verifies with ethers’verifyTypedData(passtypeswithoutEIP712Domain). - A Polymarket Safe transaction:
{"method": "eth_sign", "data": "<SafeTx hash>", "safeTxTypedData": {...}}. See Polymarket Safe transactions.
With
transaction_data, the hash you computed: the EIP-712 digest of typedData, or for a Safe transaction the EIP-191 hash of the SafeTx hash. Optional; if you send it and it doesn’t match, the request returns 400.Polymarket Safe transactions
Polymarket’s relayer only accepts Safe signatures in theeth_sign style: EIP-191 over the 32-byte SafeTx hash. To get one, send the SafeTx hash as data and the SafeTx it was computed from as safeTxTypedData:
400 unless:
safeTxTypedDatais a SafeTx with exactly the types above, anddatais its EIP-712 hashchainIdis137andverifyingContractis the user’s own Polymarket Safe, the one Polymarket’s relayer derives from the user’s wallet address- a
delegatecall(operation: 1) goes only to Polymarket’s MultiSend, and every transaction batched inside it is a plain call - no call, top-level or batched, is made to the Safe itself
signature is a plain ECDSA signature over the EIP-191 hash. Before submitting it to the relayer, pack it as Safe expects for eth_sign signatures: r, s, then a v of 31 or 32 (add 4 to a v of 27 or 28, or 31 to a v of 0 or 1).
Response Fields
The hash that was signed: the EIP-191 hash of
message, or the EIP-712 digest of transaction_data.typedData.Withdraw to External Address
Send funds from the authenticated user’s Magic wallet to an external address.cURL
message is generated by the server (success text includes amount, token, and chain, and notes EIP-7702 gas-sponsored sends when applicable). tx_hash is an EVM transaction hash (0x…) or a Solana signature string depending on chain.
Request Parameters
The recipient wallet address. EVM destinations are normalized to checksummed hex; Solana addresses are validated as base58.
Request gas-sponsored execution for EVM withdrawals when supported (Alchemy EIP-7702 path). Ignored for Solana (
should_sponsor_gas is false on SOL).